Unverified Commit 24f74e72 authored by kahmed10's avatar kahmed10 Committed by GitHub
Browse files

Add multibroadcast test to simplify_reshapes (#432)

* add multibroadcast to simplify reshapes

* formatting

* revert simplify_reshapes cpp
parent cf85b4c6
...@@ -363,4 +363,17 @@ TEST_CASE(nested_concat_partial) ...@@ -363,4 +363,17 @@ TEST_CASE(nested_concat_partial)
EXPECT(std::count_if(p.begin(), p.end(), [](auto ins) { return ins.name() == "concat"; }) == 1); EXPECT(std::count_if(p.begin(), p.end(), [](auto ins) { return ins.name() == "concat"; }) == 1);
} }
TEST_CASE(multibroadcast_simplify)
{
migraphx::program p;
std::vector<size_t> s_lens{1, 2, 3, 4};
auto s = migraphx::shape{migraphx::shape::float_type, s_lens};
auto x = p.add_parameter("x", s);
auto y = p.add_instruction(migraphx::op::multibroadcast{s_lens}, x);
p.add_instruction(migraphx::op::mul{}, y, y);
auto n = std::distance(p.begin(), p.end());
run_pass(p);
EXPECT(std::distance(p.begin(), p.end()) == n - 1);
}
int main(int argc, const char* argv[]) { test::run(argc, argv); } int main(int argc, const char* argv[]) { test::run(argc, argv); }
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