Unverified Commit 24b41844 authored by Robert Kimball's avatar Robert Kimball Committed by GitHub

enable parameter validation for all unit tests (#1385)

* enable parameter validation for all unit tests
parent af1201fd
......@@ -69,7 +69,7 @@ NGRAPH_TEST(${BACKEND_NAME}, backwards_maxpool_n4_c1_hw4_2x2_max)
auto C = make_shared<op::Parameter>(element::i32, maxpool_shape);
auto df = autodiff::backprop_function(f);
backend->call(df, {output}, {input, ep});
backend->call_with_validate(df, {output}, {input, ep});
ASSERT_TRUE(read_vector<int>(output) == expected);
}
......@@ -107,7 +107,7 @@ NGRAPH_TEST(${BACKEND_NAME}, backwards_maxpool_n2_c1_hw5_3x3_str2_max)
auto C = make_shared<op::Parameter>(element::i32, maxpool_shape);
auto df = autodiff::backprop_function(f);
backend->call(df, {output}, {input, ep});
backend->call_with_validate(df, {output}, {input, ep});
ASSERT_TRUE(read_vector<int>(output) == expected);
}
......@@ -143,7 +143,7 @@ NGRAPH_TEST(${BACKEND_NAME}, backwards_avgpool_n1_c1_hw2x2)
auto C = make_shared<op::Parameter>(element::i32, avgpool_shape);
auto df = autodiff::backprop_function(f);
backend->call(df, {output}, {input, ep});
backend->call_with_validate(df, {output}, {input, ep});
ASSERT_TRUE(read_vector<int>(output) == dataEp);
}
......@@ -176,7 +176,7 @@ NGRAPH_TEST(${BACKEND_NAME}, backwards_avgpool_n1_c1_hw4x4)
auto C = make_shared<op::Parameter>(element::i32, avgpool_shape);
auto df = autodiff::backprop_function(f);
backend->call(df, {output}, {input, ep});
backend->call_with_validate(df, {output}, {input, ep});
ASSERT_TRUE(read_vector<int>(output) == expected);
}
......@@ -275,7 +275,7 @@ NGRAPH_TEST(${BACKEND_NAME}, backwards_avgpool_n2_c2_hw4x4)
auto C = make_shared<op::Parameter>(element::i32, avgpool_shape);
auto df = autodiff::backprop_function(f);
backend->call(df, {output}, {input, ep});
backend->call_with_validate(df, {output}, {input, ep});
ASSERT_TRUE(read_vector<int>(output) == expected);
}
......@@ -1543,7 +1543,7 @@ NGRAPH_TEST(${BACKEND_NAME}, backwards_maxpool_n4c1h4w4_kh2kw2_sh1sw1)
auto C = make_shared<op::Parameter>(element::f32, maxpool_shape);
auto df = autodiff::backprop_function(f);
backend->call(df, {output}, {input, ep});
backend->call_with_validate(df, {output}, {input, ep});
ASSERT_TRUE(read_vector<float>(output) == expected);
}
......@@ -1580,7 +1580,7 @@ NGRAPH_TEST(${BACKEND_NAME}, backwards_maxpool_n2c1h5w5_kh3kw3_sh2sw2)
auto C = make_shared<op::Parameter>(element::f32, maxpool_shape);
auto df = autodiff::backprop_function(f);
backend->call(df, {output}, {input, ep});
backend->call_with_validate(df, {output}, {input, ep});
ASSERT_TRUE(read_vector<float>(output) == expected);
}
......@@ -1653,7 +1653,7 @@ NGRAPH_TEST(${BACKEND_NAME}, backwards_reverse_sequence_n3_c2_h3)
auto C = make_shared<op::Parameter>(element::i32, shape);
auto df = autodiff::backprop_function(f);
backend->call(df, {da, db}, {a, b, c});
backend->call_with_validate(df, {da, db}, {a, b, c});
ASSERT_EQ(read_vector<int>(da), expected);
}
......@@ -1703,6 +1703,6 @@ NGRAPH_TEST(${BACKEND_NAME}, backwards_reverse_sequence_n4d2c3h2w2)
auto C = make_shared<op::Parameter>(element::i32, shape);
auto df = autodiff::backprop_function(f);
backend->call(df, {da, db}, {a, b, c});
backend->call_with_validate(df, {da, db}, {a, b, c});
ASSERT_EQ(read_vector<int>(da), expected);
}
......@@ -48,7 +48,7 @@ TEST(INTERPRETER, nan_check_input)
auto result = backend->create_tensor(element::f32, shape);
ibackend->set_nan_check(f, true);
EXPECT_ANY_THROW(ibackend->call(f, {result}, {a, b}));
EXPECT_ANY_THROW(ibackend->call_with_validate(f, {result}, {a, b}));
}
TEST(INTERPRETER, nan_check_output)
......@@ -71,5 +71,5 @@ TEST(INTERPRETER, nan_check_output)
auto result = backend->create_tensor(element::f32, shape);
ibackend->set_nan_check(f, true);
EXPECT_ANY_THROW(ibackend->call(f, {result}, {a, b}));
EXPECT_ANY_THROW(ibackend->call_with_validate(f, {result}, {a, b}));
}
......@@ -98,7 +98,9 @@ TEST(benchmark, concat_32x1x200_axis1_6)
auto result_tv = backend->create_tensor(element::f32, result_shape);
result_tvs.push_back(result_tv);
std::function<void()> cb = [&]() { backend->call(f, {result_tv}, input_vals); };
std::function<void()> cb = [&]() {
backend->call_with_validate(f, {result_tv}, input_vals);
};
test_callbacks.push_back(cb);
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -34,7 +34,7 @@ shared_ptr<runtime::TensorView>
auto a = backend->create_tensor(element::f32, shape_a);
copy_data(a, vector<float>{1, 2, 3, 4, 5, 6});
auto result = backend->create_tensor(element::f32, shape_rt);
backend->call(f, {result}, {a});
backend->call_with_validate(f, {result}, {a});
return result;
}
......@@ -51,7 +51,7 @@ shared_ptr<runtime::TensorView> make_reduce_result_true(
auto a = backend->create_tensor(element::f32, shape_a);
copy_data(a, vector<float>{1, 2, 3, 4, 5, 6});
auto result = backend->create_tensor(element::f32, shape_rt);
backend->call(f, {result}, {a});
backend->call_with_validate(f, {result}, {a});
return result;
}
......@@ -68,7 +68,7 @@ shared_ptr<runtime::TensorView> make_reduce_result_false(
auto a = backend->create_tensor(element::f32, shape_a);
copy_data(a, vector<float>{1, 2, 3, 4, 5, 6});
auto result = backend->create_tensor(element::f32, shape_rt);
backend->call(f, {result}, {a});
backend->call_with_validate(f, {result}, {a});
return result;
}
......@@ -148,7 +148,7 @@ TEST(builder, tensor_mask)
copy_data(sequence_lengths_data, vector<uint32_t>{1, 3, 2});
auto result = backend->create_tensor(element::boolean, mask_shape);
backend->call(f, {result}, {sequence_lengths_data});
backend->call_with_validate(f, {result}, {sequence_lengths_data});
vector<char> expected{1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0};
EXPECT_EQ(expected, read_vector<char>(result));
......
This diff is collapsed.
......@@ -153,7 +153,7 @@ TEST(cpu_fusion, gemm_cpu_broadcast_row)
copy_data(a, dataA);
copy_data(b, dataB);
backend->call(f, {result}, {a, b});
backend->call_with_validate(f, {result}, {a, b});
vector<float> expected{11, 30, 38, 111};
EXPECT_EQ(read_vector<float>(result), expected);
}
......@@ -184,7 +184,7 @@ TEST(cpu_fusion, gemm_cpu_broadcast_column)
copy_data(a, dataA);
copy_data(b, dataB);
backend->call(f, {result}, {a, b});
backend->call_with_validate(f, {result}, {a, b});
vector<float> expected{11, 29, 39, 111};
EXPECT_EQ(read_vector<float>(result), expected);
}
......@@ -219,7 +219,7 @@ TEST(cpu_fusion, gemm_cpu_broadcast_matrix)
copy_data(a, dataA);
copy_data(b, dataB);
backend->call(f, {result}, {a, b});
backend->call_with_validate(f, {result}, {a, b});
vector<float> expected{10, 28, 37, 109};
ASSERT_TRUE(read_vector<float>(result) == expected);
}
......@@ -251,7 +251,7 @@ TEST(cpu_fusion, gemm_cpu_no_bias)
copy_data(a, dataA);
copy_data(b, dataB);
backend->call(f, {result}, {a, b});
backend->call_with_validate(f, {result}, {a, b});
vector<float> expected{9, 27, 36, 108};
ASSERT_TRUE(read_vector<float>(result) == expected);
}
......@@ -631,7 +631,7 @@ TEST(cpu_fusion, conv_bias_fprop_n1c1h3w3)
auto f = make_shared<Function>(
convolution_bias, op::ParameterVector{conv_test.data, conv_test.weights, conv_test.bias});
backend->call(
backend->call_with_validate(
f, {conv_test.result_val}, {conv_test.data_val, conv_test.weights_val, conv_test.bias_val});
auto result_vec = read_vector<float>(conv_test.result_val);
......@@ -661,7 +661,7 @@ TEST(cpu_fusion, conv_bias_bprop_n1c1h3w3)
auto df = make_shared<Function>(
NodeVector{d_data, d_weights, d_bias},
op::ParameterVector{conv_test.data, conv_test.weights, conv_test.bias, conv_test.delta});
backend->call(
backend->call_with_validate(
df,
{conv_test.d_data_val, conv_test.d_weights_val, conv_test.d_bias_val},
{conv_test.data_val, conv_test.weights_val, conv_test.bias_val, conv_test.delta_val});
......@@ -764,14 +764,14 @@ TEST(cpu_fusion, batchnorm_fprop_relu_b1c2h2w2)
auto result_mean_bnr = backend->create_tensor(element::f32, mean_shape);
auto result_variance_bnr = backend->create_tensor(element::f32, var_shape);
backend->call(f,
{bn_output,
result_mean,
result_variance,
bn_output_bnr,
result_mean_bnr,
result_variance_bnr},
{input_t, gamma_t, beta_t});
backend->call_with_validate(f,
{bn_output,
result_mean,
result_variance,
bn_output_bnr,
result_mean_bnr,
result_variance_bnr},
{input_t, gamma_t, beta_t});
EXPECT_TRUE(test::all_close(read_vector<float>(bn_output), read_vector<float>(bn_output_bnr)));
EXPECT_TRUE(
......@@ -1002,7 +1002,7 @@ std::vector<shared_ptr<runtime::TensorView>>
copy_data(data_tensor, data_val);
copy_data(weights_tensor, weights_val);
copy_data(bias_tensor, bias_val);
backend->call(func, result_tensors, {data_tensor, weights_tensor, bias_tensor});
backend->call_with_validate(func, result_tensors, {data_tensor, weights_tensor, bias_tensor});
return result_tensors;
}
......@@ -1196,7 +1196,7 @@ TEST(cpu_fusion, backwards_maxpool_with_indices_n4_c1_hw4_2x2_max)
pass_manager.run_passes(df);
}
backend->call(df, {output}, {input, ep});
backend->call_with_validate(df, {output}, {input, ep});
ASSERT_TRUE(read_vector<float>(output) == expected);
}
......@@ -1217,7 +1217,7 @@ TEST(cpu_fusion, loop_kernel_one_input_one_output)
copy_data(a, dataA);
vector<int> expected{-1, -4, -1, -4};
backend->call(f, {result}, {a});
backend->call_with_validate(f, {result}, {a});
EXPECT_EQ(read_vector<int>(result), expected);
}
......@@ -1244,7 +1244,7 @@ TEST(cpu_fusion, loop_kernel_embedded_graph)
vector<int> dataB{1, 2, 3, 4};
copy_data(b, dataB);
vector<int> expected{-2, -6, -4, -8};
backend->call(f, {result}, {a, b});
backend->call_with_validate(f, {result}, {a, b});
EXPECT_EQ(read_vector<int>(result), expected);
}
......@@ -1269,7 +1269,7 @@ TEST(cpu_fusion, loop_kernel_two_inputs_one_output)
copy_data(b, dataB);
vector<int> expected{2, 6, 4, 8};
backend->call(f, {result}, {a, b});
backend->call_with_validate(f, {result}, {a, b});
EXPECT_EQ(read_vector<int>(result), expected);
}
......@@ -1321,7 +1321,7 @@ TEST(cpu_fusion, loop_kernel_multiple_outputs)
copy_data(c, dataC);
copy_data(d, dataD);
backend->call(f, {r1, r2, r3}, {a, b, c, d});
backend->call_with_validate(f, {r1, r2, r3}, {a, b, c, d});
vector<int> expected1{5, 11, 5, 17};
vector<int> expected2{2, 7, 5, 14};
......@@ -1383,8 +1383,8 @@ TEST(cpu_fusion, loop_kernel_copy_with_new_args)
copy_data(c, dataC);
copy_data(d, dataD);
backend->call(f, {r1, r2, r3}, {a, b, c, d});
backend->call(copy_f, {copy_r1, copy_r2, copy_r3}, {a, b, c, d});
backend->call_with_validate(f, {r1, r2, r3}, {a, b, c, d});
backend->call_with_validate(copy_f, {copy_r1, copy_r2, copy_r3}, {a, b, c, d});
EXPECT_EQ(read_vector<int>(r1), read_vector<int>(copy_r1));
EXPECT_EQ(read_vector<int>(r2), read_vector<int>(copy_r2));
......@@ -1675,7 +1675,8 @@ TEST(cpu_fusion, group_convolution)
backend->create_tensor(element::f32, shape_ur, erv.data()));
auto upper_result = std::dynamic_pointer_cast<ngraph::runtime::cpu::CPUTensorView>(
backend->create_tensor(element::f32, shape_ur, erv.data() + erv.size() / 2));
backend->call(f, {group_result, lower_result, upper_result}, {a_, b_, c_, d_, e_, f_});
backend->call_with_validate(
f, {group_result, lower_result, upper_result}, {a_, b_, c_, d_, e_, f_});
ASSERT_EQ(rv, erv);
}
......@@ -1735,9 +1736,10 @@ TEST(cpu_fusion, rnn_fprop_1_lstm_cell)
copy_data(weights_iter_t, vector<float>(400 * 100, 1));
copy_data(biases_t, vector<float>(400, 1));
backend->call(func,
{result_ht, result_ct},
{src_layer_t, src_iter_t, weights_layer_t, weights_iter_t, biases_t});
backend->call_with_validate(
func,
{result_ht, result_ct},
{src_layer_t, src_iter_t, weights_layer_t, weights_iter_t, biases_t});
vector<float> expected_ht(10 * 100, 0.964028f);
vector<float> expected_ct;
for (size_t i = 0; i < 20 * 100; i++)
......@@ -2116,7 +2118,7 @@ void sigmoid_multiply_fusion_forward_compute(shared_ptr<runtime::Backend>& backe
auto mul_node = input_0_node * input_1_node;
auto func = make_shared<Function>(mul_node, input_params);
backend->call(func, {result_tensor}, input_tensors);
backend->call_with_validate(func, {result_tensor}, input_tensors);
EXPECT_TRUE(test::all_close(read_vector<float>(result_tensor), expected));
}
......@@ -2311,7 +2313,7 @@ void sigmoid_multiply_fusion_backward_compute(shared_ptr<runtime::Backend>& back
auto d_input_0 = adjoints.backprop_node(input_0_adjoint);
auto d_input_1 = adjoints.backprop_node(input_1_adjoint);
auto df = make_shared<Function>(NodeVector{d_input_0, d_input_1}, back_params);
backend->call(df, {d_input_0_tensor, d_input_1_tensor}, input_tensors);
backend->call_with_validate(df, {d_input_0_tensor, d_input_1_tensor}, input_tensors);
EXPECT_TRUE(test::all_close(read_vector<float>(d_input_0_tensor), expected_0));
EXPECT_TRUE(test::all_close(read_vector<float>(d_input_1_tensor), expected_1));
}
......
......@@ -119,15 +119,15 @@ TEST(cpu_test, abc_tbb)
copy_data(b, test::NDArray<float, 2>({{5, 6}, {7, 8}}).get_vector());
copy_data(c, test::NDArray<float, 2>({{9, 10}, {11, 12}}).get_vector());
backend->call(f, {result}, {a, b, c});
backend->call_with_validate(f, {result}, {a, b, c});
EXPECT_EQ(read_vector<float>(result),
(test::NDArray<float, 2>({{54, 80}, {110, 144}})).get_vector());
backend->call(f, {result}, {b, a, c});
backend->call_with_validate(f, {result}, {b, a, c});
EXPECT_EQ(read_vector<float>(result),
(test::NDArray<float, 2>({{54, 80}, {110, 144}})).get_vector());
backend->call(f, {result}, {a, c, b});
backend->call_with_validate(f, {result}, {a, c, b});
EXPECT_EQ(read_vector<float>(result),
(test::NDArray<float, 2>({{50, 72}, {98, 128}})).get_vector());
......@@ -187,7 +187,7 @@ TEST(cpu_test, mkldnn_layouts)
expected_result.push_back(16.0f);
}
backend->call(f, {result}, {a, b});
backend->call_with_validate(f, {result}, {a, b});
EXPECT_EQ(vector<float>{expected_result}, rv);
}
......@@ -50,6 +50,6 @@ TEST(distributed_${BACKEND_NAME}, allreduce)
std::transform(
v.begin(), v.end(), v.begin(), std::bind1st(std::multiplies<float>(), comm_size));
backend->call(f, {result}, {a});
backend->call_with_validate(f, {result}, {a});
EXPECT_EQ(v, read_vector<float>(result));
}
......@@ -100,9 +100,9 @@ public:
return true;
}
bool call(const shared_ptr<Function>& func,
const vector<shared_ptr<runtime::TensorView>>& outputs,
const vector<shared_ptr<runtime::TensorView>>& inputs)
bool call_with_validate(const shared_ptr<Function>& func,
const vector<shared_ptr<runtime::TensorView>>& outputs,
const vector<shared_ptr<runtime::TensorView>>& inputs)
{
// Get FunctionInstance
bool rc = true;
......@@ -174,7 +174,7 @@ public:
}
// Call
backend->call(sub_function, result_tvs, parameter_tvs);
backend->call_with_validate(sub_function, result_tvs, parameter_tvs);
}
return rc;
}
......@@ -320,7 +320,7 @@ TEST(graph_partition, hybrid_abc_manual)
auto f0 = make_shared<Function>(ResultVector{R0, R1}, op::ParameterVector{A, B, C});
int_backend->compile(f0);
int_backend->call(f0, {r0, r1}, {a, b, c});
int_backend->call_with_validate(f0, {r0, r1}, {a, b, c});
// f1 on CPU
auto p0 = cpu_backend->create_tensor(element::f32, shape);
......@@ -331,7 +331,7 @@ TEST(graph_partition, hybrid_abc_manual)
auto f1 = make_shared<Function>(ResultVector{R2}, op::ParameterVector{P0, P1});
cpu_backend->compile(f1);
cpu_backend->call(f1, {r2}, {p0, p1});
cpu_backend->call_with_validate(f1, {r2}, {p0, p1});
// f2 on INT
auto p2 = int_backend->create_tensor(element::f32, shape);
......@@ -340,7 +340,7 @@ TEST(graph_partition, hybrid_abc_manual)
auto f2 = make_shared<Function>(ResultVector{R}, op::ParameterVector{P2});
int_backend->compile(f2);
int_backend->call(f2, {r}, {p2});
int_backend->call_with_validate(f2, {r}, {p2});
// Check final result on INT
EXPECT_EQ(read_vector<float>(r),
......@@ -386,7 +386,7 @@ TEST(graph_partition, hybrid_abc)
copy_data(b, test::NDArray<float, 2>({{5, 6}, {7, 8}}).get_vector());
copy_data(c, test::NDArray<float, 2>({{9, 10}, {11, 12}}).get_vector());
backend->call(f, {r}, {a, b, c});
backend->call_with_validate(f, {r}, {a, b, c});
EXPECT_EQ(read_vector<float>(r),
(test::NDArray<float, 2>({{54, 80}, {110, 144}})).get_vector());
}
......@@ -425,7 +425,7 @@ TEST(graph_partition, hybrid_abcd)
copy_data(c, test::NDArray<float, 2>({{9, 10}, {11, 12}}).get_vector());
copy_data(d, test::NDArray<float, 2>({{13, 14}, {15, 16}}).get_vector());
backend->call(f, {r}, {a, b, c, d});
backend->call_with_validate(f, {r}, {a, b, c, d});
EXPECT_EQ(read_vector<float>(r), (test::NDArray<float, 2>({{32, 48}, {68, 92}})).get_vector());
}
......@@ -459,7 +459,7 @@ TEST(graph_partition, hybrid_back_and_forth)
copy_data(b, test::NDArray<float, 2>({{5, 6}, {7, 8}}).get_vector());
copy_data(c, test::NDArray<float, 2>({{9, 10}, {11, 12}}).get_vector());
backend->call(f, {r}, {a, b, c});
backend->call_with_validate(f, {r}, {a, b, c});
EXPECT_EQ(read_vector<float>(r),
(test::NDArray<float, 2>({{90, 180}, {308, 480}})).get_vector());
}
......@@ -496,7 +496,7 @@ TEST(graph_partition, hybrid_multi_middle_nodes)
copy_data(b, test::NDArray<float, 2>({{5, 6}, {7, 8}}).get_vector());
copy_data(c, test::NDArray<float, 2>({{9, 10}, {11, 12}}).get_vector());
backend->call(f, {r}, {a, b, c});
backend->call_with_validate(f, {r}, {a, b, c});
EXPECT_EQ(read_vector<float>(r),
(test::NDArray<float, 2>({{210, 288}, {378, 480}})).get_vector());
}
......@@ -522,7 +522,7 @@ TEST(graph_partition, hybrid_no_split)
copy_data(a, test::NDArray<float, 2>({{1, 2}, {3, 4}}).get_vector());
copy_data(b, test::NDArray<float, 2>({{5, 6}, {7, 8}}).get_vector());
backend->call(f, {c}, {a, b});
backend->call_with_validate(f, {c}, {a, b});
EXPECT_EQ(read_vector<float>(c), (test::NDArray<float, 2>({{6, 8}, {10, 12}})).get_vector());
}
......
......@@ -246,7 +246,7 @@ NGRAPH_TEST (${BACKEND_NAME}, %s)
vector<float> expected_result{%s};
backend->call(function, {result}, {a, b});
backend->call_with_validate(function, {result}, {a, b});
EXPECT_TRUE(test::all_close<float>(vector<float>{expected_result}, read_vector<float>(result), 1.0e-4f, 1.0e-6f));
// only test backprop for certain cases as it takes significant compute resources
if(%s) {
......
......@@ -94,13 +94,13 @@ TEST(serialize, main)
copy_data(z, vector<float>{9, 10, 11, 12});
auto result = backend->create_tensor(element::f32, shape);
backend->call(sfunc, {result}, {x, y, z});
backend->call_with_validate(sfunc, {result}, {x, y, z});
EXPECT_EQ((vector<float>{216, 320, 440, 576}), read_vector<float>(result));
backend->call(sfunc, {result}, {y, x, z});
backend->call_with_validate(sfunc, {result}, {y, x, z});
EXPECT_EQ((vector<float>{216, 320, 440, 576}), read_vector<float>(result));
backend->call(sfunc, {result}, {x, z, y});
backend->call_with_validate(sfunc, {result}, {x, z, y});
EXPECT_EQ((vector<float>{200, 288, 392, 512}), read_vector<float>(result));
}
#endif
......
......@@ -100,7 +100,7 @@ namespace ngraph
write_vector(c_arg, c_vec);
// call modified df/dX* = f'(c, cached)
backend->call(df, df_output_args, df_input_args);
backend->call_with_validate(df, df_output_args, df_input_args);
// reset the adjoint element
c_vec[i] = 0;
......@@ -198,7 +198,7 @@ namespace ngraph
}
auto clone_fwd = s_clone_fwd_map[f];
backend->call(clone_fwd, mod_f_output_args, f_input_args);
backend->call_with_validate(clone_fwd, mod_f_output_args, f_input_args);
// call modfied f'(c, cached) to get df/dX*
if (!s_clone_bwd_map[f])
......
......@@ -58,7 +58,7 @@ namespace ngraph
// ref_y is the function evaluated at the args
auto ref_y = backend->create_tensor<T>(y_shape);
backend->call(
backend->call_with_validate(
f, std::vector<std::shared_ptr<ngraph::runtime::TensorView>>{ref_y}, args);
auto ref_vec = read_vector<T>(ref_y);
......@@ -84,7 +84,7 @@ namespace ngraph
auto old_val = vec[j];
vec[j] += delta;
write_vector(arg, vec);
backend->call(f, {inc_y}, args);
backend->call_with_validate(f, {inc_y}, args);
auto inc_vec = read_vector<T>(inc_y);
vec[j] = old_val;
write_vector(arg, vec);
......
......@@ -126,7 +126,7 @@ std::vector<std::vector<T>> execute(std::shared_ptr<ngraph::Function> f,
backend->create_tensor(results.at(i)->get_element_type(), results.at(i)->get_shape());
}
backend->call(f, result_tensors, arg_tensors);
backend->call_with_validate(f, result_tensors, arg_tensors);
std::vector<std::vector<T>> result_vectors;
for (auto rt : result_tensors)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment