"test/vscode:/vscode.git/clone" did not exist on "fd3e898bf8ae228d4efd55c85b8e1396c96a9eae"
test_softmax.cpp 1.04 KB
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
12

template <int Axis, migraphx::shape::type_t T>
struct test_softmax : verify_program<test_softmax<Axis, T>>
{
    migraphx::program create_program() const
    {
        migraphx::program p;
13
        auto* mm = p.get_main_module();
14
        migraphx::shape s{T, {512, 4, 1067, 6}};
15
        auto param = mm->add_parameter("0", s);
16
        mm->add_instruction(migraphx::make_op("softmax", {{"axis", Axis}}), param);
17
18
19
20
21
22
23
24
25
26
27
28
29

        return p;
    }
};

template struct test_softmax<0, migraphx::shape::float_type>;
template struct test_softmax<2, migraphx::shape::float_type>;
template struct test_softmax<1, migraphx::shape::double_type>;
template struct test_softmax<3, migraphx::shape::double_type>;
template struct test_softmax<0, migraphx::shape::half_type>;
template struct test_softmax<1, migraphx::shape::half_type>;
template struct test_softmax<2, migraphx::shape::half_type>;
template struct test_softmax<3, migraphx::shape::half_type>;