Commit 8c62c647 authored by Shucai Xiao's avatar Shucai Xiao
Browse files

add gpu test example for the logsoftmax operator

parent 5f88d341
...@@ -2887,6 +2887,34 @@ struct test_lstm_bidirct_default_actv2 ...@@ -2887,6 +2887,34 @@ struct test_lstm_bidirct_default_actv2
} }
}; };
template<int axis>
struct test_logsoftmax
{
migraphx::program create_program() const
{
migraphx::program p;
migraphx::shape s{migraphx::shape::float_type, {3, 4, 5, 6}};
auto param = p.add_parameter("0", s);
p.add_instruction(migraphx::op::logsoftmax{axis}, param);
return p;
}
};
template<int axis>
struct test_logsoftmax_1
{
migraphx::program create_program() const
{
migraphx::program p;
migraphx::shape s{migraphx::shape::float_type, {3}};
auto param = p.add_parameter("0", s);
p.add_instruction(migraphx::op::logsoftmax{axis}, param);
return p;
}
};
int main() int main()
{ {
verify_program<test_relu_lrn>(); verify_program<test_relu_lrn>();
...@@ -2999,4 +3027,12 @@ int main() ...@@ -2999,4 +3027,12 @@ int main()
verify_program<test_lstm_bidirct_default_actv>(); verify_program<test_lstm_bidirct_default_actv>();
verify_program<test_lstm_bidirct_default_actv1>(); verify_program<test_lstm_bidirct_default_actv1>();
verify_program<test_lstm_bidirct_default_actv2>(); verify_program<test_lstm_bidirct_default_actv2>();
verify_program<test_logsoftmax<0>>();
verify_program<test_logsoftmax<1>>();
verify_program<test_logsoftmax<2>>();
verify_program<test_logsoftmax<3>>();
verify_program<test_logsoftmax<4>>();
verify_program<test_logsoftmax_1<0>>();
verify_program<test_logsoftmax_1<1>>();
} }
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