Commit 4089bcb6 authored by Shucai Xiao's avatar Shucai Xiao
Browse files

clang format

parent dc57c9c1
...@@ -602,12 +602,12 @@ TEST_CASE(lstm_forward) ...@@ -602,12 +602,12 @@ TEST_CASE(lstm_forward)
float clip = 0.0f; float clip = 0.0f;
int input_forget = 1; int input_forget = 1;
migraphx::shape seq_shape{migraphx::shape::float_type, {sl, bs, is}}; migraphx::shape seq_shape{migraphx::shape::float_type, {sl, bs, is}};
migraphx::shape w_shape{migraphx::shape::float_type, {nd, 4*hs, is}}; migraphx::shape w_shape{migraphx::shape::float_type, {nd, 4 * hs, is}};
migraphx::shape r_shape{migraphx::shape::float_type, {nd, 4*hs, hs}}; migraphx::shape r_shape{migraphx::shape::float_type, {nd, 4 * hs, hs}};
migraphx::shape bias_shape{migraphx::shape::float_type, {nd, 8 * hs}}; migraphx::shape bias_shape{migraphx::shape::float_type, {nd, 8 * hs}};
migraphx::shape sl_shape{migraphx::shape::int32_type, {bs}}; migraphx::shape sl_shape{migraphx::shape::int32_type, {bs}};
migraphx::shape ih_shape{migraphx::shape::float_type, {nd, bs, hs}}; migraphx::shape ih_shape{migraphx::shape::float_type, {nd, bs, hs}};
migraphx::shape pph_shape{migraphx::shape::float_type, {nd, 3*hs}}; migraphx::shape pph_shape{migraphx::shape::float_type, {nd, 3 * hs}};
{ {
migraphx::program p; migraphx::program p;
auto seq = p.add_parameter("seq", seq_shape); auto seq = p.add_parameter("seq", seq_shape);
...@@ -619,11 +619,13 @@ TEST_CASE(lstm_forward) ...@@ -619,11 +619,13 @@ TEST_CASE(lstm_forward)
auto ic = p.add_parameter("c0", ih_shape); auto ic = p.add_parameter("c0", ih_shape);
auto pph = p.add_parameter("pph", pph_shape); auto pph = p.add_parameter("pph", pph_shape);
auto out_hs = auto out_hs = p.add_instruction(
p.add_instruction(migraphx::op::lstm{hs, migraphx::op::lstm{
hs,
{migraphx::op::sigmoid{}, migraphx::op::tanh{}, migraphx::op::tanh{}}, {migraphx::op::sigmoid{}, migraphx::op::tanh{}, migraphx::op::tanh{}},
migraphx::op::rnn_direction::forward, migraphx::op::rnn_direction::forward,
clip, input_forget}, clip,
input_forget},
seq, seq,
w, w,
r, r,
...@@ -650,12 +652,12 @@ TEST_CASE(lstm_reverse) ...@@ -650,12 +652,12 @@ TEST_CASE(lstm_reverse)
float clip = 0.0f; float clip = 0.0f;
int input_forget = 1; int input_forget = 1;
migraphx::shape seq_shape{migraphx::shape::float_type, {sl, bs, is}}; migraphx::shape seq_shape{migraphx::shape::float_type, {sl, bs, is}};
migraphx::shape w_shape{migraphx::shape::float_type, {nd, 4*hs, is}}; migraphx::shape w_shape{migraphx::shape::float_type, {nd, 4 * hs, is}};
migraphx::shape r_shape{migraphx::shape::float_type, {nd, 4*hs, hs}}; migraphx::shape r_shape{migraphx::shape::float_type, {nd, 4 * hs, hs}};
migraphx::shape bias_shape{migraphx::shape::float_type, {nd, 8 * hs}}; migraphx::shape bias_shape{migraphx::shape::float_type, {nd, 8 * hs}};
migraphx::shape sl_shape{migraphx::shape::int32_type, {bs}}; migraphx::shape sl_shape{migraphx::shape::int32_type, {bs}};
migraphx::shape ih_shape{migraphx::shape::float_type, {nd, bs, hs}}; migraphx::shape ih_shape{migraphx::shape::float_type, {nd, bs, hs}};
migraphx::shape pph_shape{migraphx::shape::float_type, {nd, 3*hs}}; migraphx::shape pph_shape{migraphx::shape::float_type, {nd, 3 * hs}};
{ {
migraphx::program p; migraphx::program p;
auto seq = p.add_parameter("seq", seq_shape); auto seq = p.add_parameter("seq", seq_shape);
...@@ -667,11 +669,13 @@ TEST_CASE(lstm_reverse) ...@@ -667,11 +669,13 @@ TEST_CASE(lstm_reverse)
auto ic = p.add_parameter("c0", ih_shape); auto ic = p.add_parameter("c0", ih_shape);
auto pph = p.add_parameter("pph", pph_shape); auto pph = p.add_parameter("pph", pph_shape);
auto out_hs = auto out_hs = p.add_instruction(
p.add_instruction(migraphx::op::lstm{hs, migraphx::op::lstm{
hs,
{migraphx::op::sigmoid{}, migraphx::op::tanh{}, migraphx::op::tanh{}}, {migraphx::op::sigmoid{}, migraphx::op::tanh{}, migraphx::op::tanh{}},
migraphx::op::rnn_direction::reverse, migraphx::op::rnn_direction::reverse,
clip, input_forget}, clip,
input_forget},
seq, seq,
w, w,
r, r,
...@@ -698,12 +702,12 @@ TEST_CASE(lstm_bidirectional) ...@@ -698,12 +702,12 @@ TEST_CASE(lstm_bidirectional)
float clip = 0.0f; float clip = 0.0f;
int input_forget = 1; int input_forget = 1;
migraphx::shape seq_shape{migraphx::shape::float_type, {sl, bs, is}}; migraphx::shape seq_shape{migraphx::shape::float_type, {sl, bs, is}};
migraphx::shape w_shape{migraphx::shape::float_type, {nd, 4*hs, is}}; migraphx::shape w_shape{migraphx::shape::float_type, {nd, 4 * hs, is}};
migraphx::shape r_shape{migraphx::shape::float_type, {nd, 4*hs, hs}}; migraphx::shape r_shape{migraphx::shape::float_type, {nd, 4 * hs, hs}};
migraphx::shape bias_shape{migraphx::shape::float_type, {nd, 8 * hs}}; migraphx::shape bias_shape{migraphx::shape::float_type, {nd, 8 * hs}};
migraphx::shape sl_shape{migraphx::shape::int32_type, {bs}}; migraphx::shape sl_shape{migraphx::shape::int32_type, {bs}};
migraphx::shape ih_shape{migraphx::shape::float_type, {nd, bs, hs}}; migraphx::shape ih_shape{migraphx::shape::float_type, {nd, bs, hs}};
migraphx::shape pph_shape{migraphx::shape::float_type, {nd, 3*hs}}; migraphx::shape pph_shape{migraphx::shape::float_type, {nd, 3 * hs}};
{ {
migraphx::program p; migraphx::program p;
auto seq = p.add_parameter("seq", seq_shape); auto seq = p.add_parameter("seq", seq_shape);
...@@ -715,11 +719,13 @@ TEST_CASE(lstm_bidirectional) ...@@ -715,11 +719,13 @@ TEST_CASE(lstm_bidirectional)
auto ic = p.add_parameter("c0", ih_shape); auto ic = p.add_parameter("c0", ih_shape);
auto pph = p.add_parameter("pph", pph_shape); auto pph = p.add_parameter("pph", pph_shape);
auto out_hs = auto out_hs = p.add_instruction(
p.add_instruction(migraphx::op::lstm{hs, migraphx::op::lstm{
hs,
{migraphx::op::sigmoid{}, migraphx::op::tanh{}, migraphx::op::tanh{}}, {migraphx::op::sigmoid{}, migraphx::op::tanh{}, migraphx::op::tanh{}},
migraphx::op::rnn_direction::bidirectional, migraphx::op::rnn_direction::bidirectional,
clip, input_forget}, clip,
input_forget},
seq, seq,
w, w,
r, r,
......
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