Commit 6040f741 authored by Ted Themistokleous's avatar Ted Themistokleous
Browse files

Fix test failures from previous change to read in protobuf data types...

Fix test failures from previous change to read in protobuf data types correctly for empty constants.

Instead of assuming things are empty and thus we default to float, reading in the correct types broke some assumptions code was using for an empty literal.
parent cb2cd068
...@@ -660,7 +660,7 @@ TEST_CASE(const_of_shape_empty_input_test) ...@@ -660,7 +660,7 @@ TEST_CASE(const_of_shape_empty_input_test)
{ {
migraphx::program p; migraphx::program p;
auto* mm = p.get_main_module(); auto* mm = p.get_main_module();
mm->add_literal(migraphx::literal()); mm->add_literal(migraphx::literal(migraphx::shape::int32_type));
migraphx::shape s(migraphx::shape::int64_type, {1}, {0}); migraphx::shape s(migraphx::shape::int64_type, {1}, {0});
std::vector<int64_t> vec(s.elements(), 10); std::vector<int64_t> vec(s.elements(), 10);
mm->add_literal(migraphx::literal(s, vec)); mm->add_literal(migraphx::literal(s, vec));
...@@ -3922,7 +3922,7 @@ TEST_CASE(reducesum_empty_axes_test) ...@@ -3922,7 +3922,7 @@ TEST_CASE(reducesum_empty_axes_test)
{ {
migraphx::program p; migraphx::program p;
auto* mm = p.get_main_module(); auto* mm = p.get_main_module();
mm->add_literal({}); mm->add_literal(migraphx::literal{migraphx::shape::int64_type});
auto x = mm->add_parameter("x", migraphx::shape{migraphx::shape::float_type, {3, 4, 5, 6}}); auto x = mm->add_parameter("x", migraphx::shape{migraphx::shape::float_type, {3, 4, 5, 6}});
auto l1 = mm->add_instruction(migraphx::make_op("reduce_sum", {{"axes", {0, 1, 2, 3}}}), x); auto l1 = mm->add_instruction(migraphx::make_op("reduce_sum", {{"axes", {0, 1, 2, 3}}}), x);
auto r = mm->add_instruction(migraphx::make_op("squeeze", {{"axes", {0, 1, 2, 3}}}), l1); auto r = mm->add_instruction(migraphx::make_op("squeeze", {{"axes", {0, 1, 2, 3}}}), l1);
...@@ -3937,7 +3937,7 @@ TEST_CASE(reducesum_noop_test) ...@@ -3937,7 +3937,7 @@ TEST_CASE(reducesum_noop_test)
{ {
migraphx::program p; migraphx::program p;
auto* mm = p.get_main_module(); auto* mm = p.get_main_module();
mm->add_literal({}); mm->add_literal(migraphx::literal{migraphx::shape::int64_type});
auto x = mm->add_parameter("x", migraphx::shape{migraphx::shape::float_type, {3, 4, 5, 6}}); auto x = mm->add_parameter("x", migraphx::shape{migraphx::shape::float_type, {3, 4, 5, 6}});
mm->add_return({x}); mm->add_return({x});
auto prog = migraphx::parse_onnx("reducesum_noop_test.onnx"); auto prog = migraphx::parse_onnx("reducesum_noop_test.onnx");
...@@ -5147,7 +5147,7 @@ TEST_CASE(squeeze_empty_axes_test) ...@@ -5147,7 +5147,7 @@ TEST_CASE(squeeze_empty_axes_test)
{ {
migraphx::program p; migraphx::program p;
auto* mm = p.get_main_module(); auto* mm = p.get_main_module();
mm->add_literal({}); mm->add_literal(migraphx::literal{migraphx::shape::int64_type});
auto l0 = mm->add_parameter("x", migraphx::shape{migraphx::shape::float_type, {3, 1, 5, 1}}); auto l0 = mm->add_parameter("x", migraphx::shape{migraphx::shape::float_type, {3, 1, 5, 1}});
auto l1 = mm->add_instruction(migraphx::make_op("squeeze"), l0); auto l1 = mm->add_instruction(migraphx::make_op("squeeze"), l0);
mm->add_return({l1}); mm->add_return({l1});
......
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