Commit b9cbd039 authored by shssf's avatar shssf Committed by Robert Kimball

TEST: simple test with one constant to two outputs (#1537)

parent 817210cf
......@@ -80,6 +80,7 @@ select_and_scatter_without_overlap
select_and_scatter_with_overlap
sign
tan
tensor_2constant
tensor_constant_int64
validate_call_input_type
validate_call_output_type
......
......@@ -1740,6 +1740,23 @@ NGRAPH_TEST(${BACKEND_NAME}, tensor_constant)
EXPECT_EQ((vector<float>{1, 2, 3, 4, 5, 6, 7, 8}), read_vector<float>(result));
}
NGRAPH_TEST(${BACKEND_NAME}, tensor_2constant)
{
Shape shape{2, 2, 2};
auto A = op::Constant::create(element::f32, shape, {1, 2, 3, 4, 5, 6, 7, 8});
auto f = make_shared<Function>(NodeVector{A, A}, op::ParameterVector{});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
// Create some tensors for input/output
auto result0 = backend->create_tensor(element::f32, shape);
auto result1 = backend->create_tensor(element::f32, shape);
backend->call_with_validate(f, {result0, result1}, {});
EXPECT_EQ((vector<float>{1, 2, 3, 4, 5, 6, 7, 8}), read_vector<float>(result0));
EXPECT_EQ((vector<float>{1, 2, 3, 4, 5, 6, 7, 8}), read_vector<float>(result1));
}
NGRAPH_TEST(${BACKEND_NAME}, tensor_constant_with_op)
{
Shape shape{2, 2, 2};
......
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