test_concat_transpose2.cpp 910 Bytes
Newer Older
1
2
3
4

#include "verify_program.hpp"
#include <migraphx/program.hpp>
#include <migraphx/generate.hpp>
5
#include <migraphx/make_op.hpp>
6
7
8
9
10
11

struct test_concat_transpose2 : verify_program<test_concat_transpose2>
{
    migraphx::program create_program() const
    {
        migraphx::program p;
12
        auto* mm = p.get_main_module();
13
14
15
16
        int axis = 1;
        migraphx::shape s0{migraphx::shape::int32_type, {2, 2}};
        migraphx::shape s1{migraphx::shape::int32_type, {2, 3}};
        migraphx::shape s2{migraphx::shape::int32_type, {5, 2}};
17
18
19
        auto l0  = mm->add_parameter("x", s0);
        auto l1  = mm->add_parameter("y", s1);
        auto lp2 = mm->add_parameter("z", s2);
20
21
        auto l2 =
            mm->add_instruction(migraphx::make_op("transpose", {{"permutation", {1, 0}}}), lp2);
22
        mm->add_instruction(migraphx::make_op("concat", {{"axis", axis}}), l0, l1, l2);
23
24
25
        return p;
    }
};