Commit 96a4cec2 authored by Shucai Xiao's avatar Shucai Xiao
Browse files

remove unnecessary changes

parent 3b46ba9d
...@@ -74,23 +74,8 @@ void eliminate_contiguous::apply(module& p) const ...@@ -74,23 +74,8 @@ void eliminate_contiguous::apply(module& p) const
for(auto ins : iterator_for(p)) for(auto ins : iterator_for(p))
{ {
// return instruction should have inputs with standard shape // return instruction should have inputs with standard shape
if(ins->name() == "@return") if(ins->name() == "@return")
{
auto args = ins->inputs();
std::transform(args.begin(), args.end(), args.begin(), [&](auto in) {
if(in->name() != op_name)
return in;
auto prev = in->inputs().front();
return prev->get_shape().standard() ? prev : in;
});
if(args != ins->inputs())
{
p.replace_instruction(ins, ins->get_operator(), args);
}
continue; continue;
}
// Make a copy so we can modify it while we iterate // Make a copy so we can modify it while we iterate
auto args = ins->inputs(); auto args = ins->inputs();
......
...@@ -161,19 +161,6 @@ TEST_CASE(standard_flatten_op) ...@@ -161,19 +161,6 @@ TEST_CASE(standard_flatten_op)
EXPECT(std::distance(m.begin(), m.end()) == (count - 1)); EXPECT(std::distance(m.begin(), m.end()) == (count - 1));
} }
TEST_CASE(standard_return_input)
{
migraphx::module m;
auto l = m.add_literal(get_2x2());
auto tl = m.add_instruction(migraphx::make_op("add"), l, l);
auto c = m.add_instruction(migraphx::make_op("contiguous"), tl);
m.add_return({c});
auto count = std::distance(m.begin(), m.end());
run_pass(m);
EXPECT(std::distance(m.begin(), m.end()) == count - 1);
}
TEST_CASE(contiguous_pointwise) TEST_CASE(contiguous_pointwise)
{ {
migraphx::shape s{migraphx::shape::float_type, {2, 3, 8, 8}}; migraphx::shape s{migraphx::shape::float_type, {2, 3, 8, 8}};
......
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