This patch add warmup forwarding to the layer golden test
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
inputs = _rand_like(input_shape)
initial_weights = [tf.Variable(i) for i in layer.weights]
+
+ for _ in range(4):
+ layer.call(inputs, **call_args) # warm layer multiple times
+
with tf.GradientTape(persistent=True) as tape:
tape.watch(inputs)
outputs = layer.call(inputs, **call_args)
bool skip_calc_grad = shouldSkipCalcGrad();
bool skip_calc_deriv = shouldSkipCalcDeriv();
+ for (int i = 0; i < 4; ++i) {
+ /// warm layer multiple times
+ layer->forwarding(rc, !shouldForwardWithInferenceMode());
+ }
+
layer->forwarding(rc, !shouldForwardWithInferenceMode());
if (!skip_calc_grad) {
layer->calcGradient(rc);