Commit 427bbe21 authored by Shucai Xiao's avatar Shucai Xiao
Browse files

changed a scenario and fixed two test cases.

parent cfe5234e
...@@ -28,12 +28,11 @@ static bool try_compute_shape(instruction_ref ins, const std::vector<shape>& inp ...@@ -28,12 +28,11 @@ static bool try_compute_shape(instruction_ref ins, const std::vector<shape>& inp
auto outputs = ins->outputs(); auto outputs = ins->outputs();
// If the current instruction has no output, it means it is the last // If the current instruction has no output, it means it is the last
// instruction and generates a non-standard output. But for unary // instruction and generates a non-standard output shape, and the last
// and binary operators, we can still remove it and reshape the output // output shape is different from the case with the contiguous operator
// to be standard since these operator can handle non-standard inputs
if(outputs.empty()) if(outputs.empty())
{ {
return true; return false;
} }
for(auto output : outputs) for(auto output : outputs)
......
...@@ -40,7 +40,7 @@ TEST_CASE(non_standard_op) ...@@ -40,7 +40,7 @@ TEST_CASE(non_standard_op)
p.add_instruction(pass_op{}, c); p.add_instruction(pass_op{}, c);
auto count = std::distance(p.begin(), p.end()); auto count = std::distance(p.begin(), p.end());
p.compile(eliminate_contiguous_target{}); p.compile(eliminate_contiguous_target{});
EXPECT(std::distance(p.begin(), p.end()) == (count - 1)); EXPECT(std::distance(p.begin(), p.end()) == count);
} }
TEST_CASE(transpose_gemm) TEST_CASE(transpose_gemm)
......
...@@ -61,7 +61,7 @@ TEST_CASE(tanh_shape) ...@@ -61,7 +61,7 @@ TEST_CASE(tanh_shape)
} }
EXPECT(p1 != p2); EXPECT(p1 != p2);
migraphx::run_passes(p2, migraphx::run_passes(p1,
{migraphx::gpu::adjust_allocation{}, migraphx::dead_code_elimination{}}); {migraphx::gpu::adjust_allocation{}, migraphx::dead_code_elimination{}});
EXPECT(p1 == p2); EXPECT(p1 == p2);
} }
......
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