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

add a test example for the scenario of reshape after transpose.

parent 8c1acf39
...@@ -825,6 +825,22 @@ struct test_contiguous ...@@ -825,6 +825,22 @@ struct test_contiguous
} }
}; };
struct test_eliminate_contiguous
{
migraphx::program create_program() const
{
migraphx::program p;
migraphx::shape s{migraphx::shape::float_type, {2, 3, 4, 5}};
auto seq = p.add_parameter("seq", s);
std::vector<int64_t> perm{0, 2, 1, 3};
auto tran_seq = p.add_instruction(migraphx::op::transpose{perm}, seq);
std::vector<int64_t> out_shape{0, 0, -1};
p.add_instruction(migraphx::op::reshape{out_shape}, tran_seq);
return p;
}
};
struct test_transpose struct test_transpose
{ {
migraphx::program create_program() const migraphx::program create_program() const
...@@ -2878,6 +2894,7 @@ int main() ...@@ -2878,6 +2894,7 @@ int main()
verify_program<test_gemm_transposea>(); verify_program<test_gemm_transposea>();
verify_program<test_gemm_transposeab>(); verify_program<test_gemm_transposeab>();
verify_program<test_contiguous>(); verify_program<test_contiguous>();
verify_program<test_eliminate_contiguous>();
verify_program<test_transpose>(); verify_program<test_transpose>();
verify_program<test_batchnorm_inference>(); verify_program<test_batchnorm_inference>();
verify_program<test_batchnorm_inference_2>(); verify_program<test_batchnorm_inference_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