Commit 3854a5e1 authored by Shucai Xiao's avatar Shucai Xiao
Browse files

clang format

parent 76f115c2
...@@ -1517,8 +1517,10 @@ struct test_gru_forward_last ...@@ -1517,8 +1517,10 @@ struct test_gru_forward_last
migraphx::program p; migraphx::program p;
migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}}; migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}};
migraphx::shape w_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, input_size}}; migraphx::shape w_shape{migraphx::shape::float_type,
migraphx::shape r_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, hidden_size}}; {num_dirct, 3 * hidden_size, input_size}};
migraphx::shape r_shape{migraphx::shape::float_type,
{num_dirct, 3 * hidden_size, hidden_size}};
migraphx::shape b_shape{migraphx::shape::float_type, {num_dirct, 6 * hidden_size}}; migraphx::shape b_shape{migraphx::shape::float_type, {num_dirct, 6 * hidden_size}};
migraphx::shape ih_shape{migraphx::shape::float_type, {num_dirct, batch_size, hidden_size}}; migraphx::shape ih_shape{migraphx::shape::float_type, {num_dirct, batch_size, hidden_size}};
...@@ -1559,8 +1561,10 @@ struct test_gru_forward_hs ...@@ -1559,8 +1561,10 @@ struct test_gru_forward_hs
migraphx::program p; migraphx::program p;
migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}}; migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}};
migraphx::shape w_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, input_size}}; migraphx::shape w_shape{migraphx::shape::float_type,
migraphx::shape r_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, hidden_size}}; {num_dirct, 3 * hidden_size, input_size}};
migraphx::shape r_shape{migraphx::shape::float_type,
{num_dirct, 3 * hidden_size, hidden_size}};
migraphx::shape b_shape{migraphx::shape::float_type, {num_dirct, 6 * hidden_size}}; migraphx::shape b_shape{migraphx::shape::float_type, {num_dirct, 6 * hidden_size}};
migraphx::shape ih_shape{migraphx::shape::float_type, {num_dirct, batch_size, hidden_size}}; migraphx::shape ih_shape{migraphx::shape::float_type, {num_dirct, batch_size, hidden_size}};
...@@ -1572,15 +1576,15 @@ struct test_gru_forward_hs ...@@ -1572,15 +1576,15 @@ struct test_gru_forward_hs
auto und = p.add_instruction(migraphx::op::undefined{}); auto und = p.add_instruction(migraphx::op::undefined{});
p.add_instruction(migraphx::op::gru{hidden_size, p.add_instruction(migraphx::op::gru{hidden_size,
{migraphx::op::sigmoid{}, migraphx::op::tanh{}}, {migraphx::op::sigmoid{}, migraphx::op::tanh{}},
migraphx::op::gru::forward, migraphx::op::gru::forward,
clip}, clip},
seq, seq,
w, w,
r, r,
bias, bias,
und, und,
ih); ih);
return p; return p;
} }
...@@ -1599,22 +1603,24 @@ struct test_gru_forward_3args_und ...@@ -1599,22 +1603,24 @@ struct test_gru_forward_3args_und
migraphx::program p; migraphx::program p;
migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}}; migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}};
migraphx::shape w_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, input_size}}; migraphx::shape w_shape{migraphx::shape::float_type,
migraphx::shape r_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, hidden_size}}; {num_dirct, 3 * hidden_size, input_size}};
auto seq = p.add_parameter("seq", in_shape); migraphx::shape r_shape{migraphx::shape::float_type,
auto w = p.add_parameter("w", w_shape); {num_dirct, 3 * hidden_size, hidden_size}};
auto r = p.add_parameter("r", r_shape); auto seq = p.add_parameter("seq", in_shape);
auto und = p.add_instruction(migraphx::op::undefined{}); auto w = p.add_parameter("w", w_shape);
auto r = p.add_parameter("r", r_shape);
auto und = p.add_instruction(migraphx::op::undefined{});
p.add_instruction(migraphx::op::gru{hidden_size, p.add_instruction(migraphx::op::gru{hidden_size,
{migraphx::op::sigmoid{}, migraphx::op::tanh{}}, {migraphx::op::sigmoid{}, migraphx::op::tanh{}},
migraphx::op::gru::forward, migraphx::op::gru::forward,
clip}, clip},
seq, seq,
w, w,
r, r,
und, und,
und, und,
und); und);
return p; return p;
} }
...@@ -1633,18 +1639,20 @@ struct test_gru_forward_3args ...@@ -1633,18 +1639,20 @@ struct test_gru_forward_3args
migraphx::program p; migraphx::program p;
migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}}; migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}};
migraphx::shape w_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, input_size}}; migraphx::shape w_shape{migraphx::shape::float_type,
migraphx::shape r_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, hidden_size}}; {num_dirct, 3 * hidden_size, input_size}};
auto seq = p.add_parameter("seq", in_shape); migraphx::shape r_shape{migraphx::shape::float_type,
auto w = p.add_parameter("w", w_shape); {num_dirct, 3 * hidden_size, hidden_size}};
auto r = p.add_parameter("r", r_shape); auto seq = p.add_parameter("seq", in_shape);
auto w = p.add_parameter("w", w_shape);
auto r = p.add_parameter("r", r_shape);
p.add_instruction(migraphx::op::gru{hidden_size, p.add_instruction(migraphx::op::gru{hidden_size,
{migraphx::op::sigmoid{}, migraphx::op::tanh{}}, {migraphx::op::sigmoid{}, migraphx::op::tanh{}},
migraphx::op::gru::forward, migraphx::op::gru::forward,
clip}, clip},
seq, seq,
w, w,
r); r);
return p; return p;
} }
...@@ -1663,18 +1671,20 @@ struct test_gru_forward_seq1 ...@@ -1663,18 +1671,20 @@ struct test_gru_forward_seq1
migraphx::program p; migraphx::program p;
migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}}; migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}};
migraphx::shape w_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, input_size}}; migraphx::shape w_shape{migraphx::shape::float_type,
migraphx::shape r_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, hidden_size}}; {num_dirct, 3 * hidden_size, input_size}};
auto seq = p.add_parameter("seq", in_shape); migraphx::shape r_shape{migraphx::shape::float_type,
auto w = p.add_parameter("w", w_shape); {num_dirct, 3 * hidden_size, hidden_size}};
auto r = p.add_parameter("r", r_shape); auto seq = p.add_parameter("seq", in_shape);
auto w = p.add_parameter("w", w_shape);
auto r = p.add_parameter("r", r_shape);
p.add_instruction(migraphx::op::gru{hidden_size, p.add_instruction(migraphx::op::gru{hidden_size,
{migraphx::op::sigmoid{}, migraphx::op::tanh{}}, {migraphx::op::sigmoid{}, migraphx::op::tanh{}},
migraphx::op::gru::forward, migraphx::op::gru::forward,
clip}, clip},
seq, seq,
w, w,
r); r);
return p; return p;
} }
...@@ -1693,18 +1703,15 @@ struct test_gru_forward_default_actv ...@@ -1693,18 +1703,15 @@ struct test_gru_forward_default_actv
migraphx::program p; migraphx::program p;
migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}}; migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}};
migraphx::shape w_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, input_size}}; migraphx::shape w_shape{migraphx::shape::float_type,
migraphx::shape r_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, hidden_size}}; {num_dirct, 3 * hidden_size, input_size}};
auto seq = p.add_parameter("seq", in_shape); migraphx::shape r_shape{migraphx::shape::float_type,
auto w = p.add_parameter("w", w_shape); {num_dirct, 3 * hidden_size, hidden_size}};
auto r = p.add_parameter("r", r_shape); auto seq = p.add_parameter("seq", in_shape);
p.add_instruction(migraphx::op::gru{hidden_size, auto w = p.add_parameter("w", w_shape);
{}, auto r = p.add_parameter("r", r_shape);
migraphx::op::gru::forward, p.add_instruction(
clip}, migraphx::op::gru{hidden_size, {}, migraphx::op::gru::forward, clip}, seq, w, r);
seq,
w,
r);
return p; return p;
} }
...@@ -1723,8 +1730,10 @@ struct test_gru_forward_default_actv1 ...@@ -1723,8 +1730,10 @@ struct test_gru_forward_default_actv1
migraphx::program p; migraphx::program p;
migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}}; migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}};
migraphx::shape w_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, input_size}}; migraphx::shape w_shape{migraphx::shape::float_type,
migraphx::shape r_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, hidden_size}}; {num_dirct, 3 * hidden_size, input_size}};
migraphx::shape r_shape{migraphx::shape::float_type,
{num_dirct, 3 * hidden_size, hidden_size}};
migraphx::shape b_shape{migraphx::shape::float_type, {num_dirct, 6 * hidden_size}}; migraphx::shape b_shape{migraphx::shape::float_type, {num_dirct, 6 * hidden_size}};
migraphx::shape ih_shape{migraphx::shape::float_type, {num_dirct, batch_size, hidden_size}}; migraphx::shape ih_shape{migraphx::shape::float_type, {num_dirct, batch_size, hidden_size}};
...@@ -1735,16 +1744,15 @@ struct test_gru_forward_default_actv1 ...@@ -1735,16 +1744,15 @@ struct test_gru_forward_default_actv1
auto ih = p.add_parameter("ih", ih_shape); auto ih = p.add_parameter("ih", ih_shape);
auto und = p.add_instruction(migraphx::op::undefined{}); auto und = p.add_instruction(migraphx::op::undefined{});
p.add_instruction(migraphx::op::gru{hidden_size, p.add_instruction(
{migraphx::op::sigmoid{}}, migraphx::op::gru{
migraphx::op::gru::forward, hidden_size, {migraphx::op::sigmoid{}}, migraphx::op::gru::forward, clip},
clip}, seq,
seq, w,
w, r,
r, bias,
bias, und,
und, ih);
ih);
return p; return p;
} }
...@@ -1763,8 +1771,10 @@ struct test_gru_reverse_last ...@@ -1763,8 +1771,10 @@ struct test_gru_reverse_last
migraphx::program p; migraphx::program p;
migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}}; migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}};
migraphx::shape w_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, input_size}}; migraphx::shape w_shape{migraphx::shape::float_type,
migraphx::shape r_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, hidden_size}}; {num_dirct, 3 * hidden_size, input_size}};
migraphx::shape r_shape{migraphx::shape::float_type,
{num_dirct, 3 * hidden_size, hidden_size}};
migraphx::shape b_shape{migraphx::shape::float_type, {num_dirct, 6 * hidden_size}}; migraphx::shape b_shape{migraphx::shape::float_type, {num_dirct, 6 * hidden_size}};
migraphx::shape ih_shape{migraphx::shape::float_type, {num_dirct, batch_size, hidden_size}}; migraphx::shape ih_shape{migraphx::shape::float_type, {num_dirct, batch_size, hidden_size}};
...@@ -1805,18 +1815,20 @@ struct test_gru_reverse_3args ...@@ -1805,18 +1815,20 @@ struct test_gru_reverse_3args
migraphx::program p; migraphx::program p;
migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}}; migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}};
migraphx::shape w_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, input_size}}; migraphx::shape w_shape{migraphx::shape::float_type,
migraphx::shape r_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, hidden_size}}; {num_dirct, 3 * hidden_size, input_size}};
auto seq = p.add_parameter("seq", in_shape); migraphx::shape r_shape{migraphx::shape::float_type,
auto w = p.add_parameter("w", w_shape); {num_dirct, 3 * hidden_size, hidden_size}};
auto r = p.add_parameter("r", r_shape); auto seq = p.add_parameter("seq", in_shape);
auto w = p.add_parameter("w", w_shape);
auto r = p.add_parameter("r", r_shape);
p.add_instruction(migraphx::op::gru{hidden_size, p.add_instruction(migraphx::op::gru{hidden_size,
{migraphx::op::sigmoid{}, migraphx::op::tanh{}}, {migraphx::op::sigmoid{}, migraphx::op::tanh{}},
migraphx::op::gru::reverse, migraphx::op::gru::reverse,
clip}, clip},
seq, seq,
w, w,
r); r);
return p; return p;
} }
...@@ -1835,8 +1847,10 @@ struct test_gru_bidirct_last ...@@ -1835,8 +1847,10 @@ struct test_gru_bidirct_last
migraphx::program p; migraphx::program p;
migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}}; migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}};
migraphx::shape w_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, input_size}}; migraphx::shape w_shape{migraphx::shape::float_type,
migraphx::shape r_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, hidden_size}}; {num_dirct, 3 * hidden_size, input_size}};
migraphx::shape r_shape{migraphx::shape::float_type,
{num_dirct, 3 * hidden_size, hidden_size}};
migraphx::shape b_shape{migraphx::shape::float_type, {num_dirct, 6 * hidden_size}}; migraphx::shape b_shape{migraphx::shape::float_type, {num_dirct, 6 * hidden_size}};
migraphx::shape ih_shape{migraphx::shape::float_type, {num_dirct, batch_size, hidden_size}}; migraphx::shape ih_shape{migraphx::shape::float_type, {num_dirct, batch_size, hidden_size}};
...@@ -1877,8 +1891,10 @@ struct test_gru_bidirct_hs ...@@ -1877,8 +1891,10 @@ struct test_gru_bidirct_hs
migraphx::program p; migraphx::program p;
migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}}; migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}};
migraphx::shape w_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, input_size}}; migraphx::shape w_shape{migraphx::shape::float_type,
migraphx::shape r_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, hidden_size}}; {num_dirct, 3 * hidden_size, input_size}};
migraphx::shape r_shape{migraphx::shape::float_type,
{num_dirct, 3 * hidden_size, hidden_size}};
migraphx::shape b_shape{migraphx::shape::float_type, {num_dirct, 6 * hidden_size}}; migraphx::shape b_shape{migraphx::shape::float_type, {num_dirct, 6 * hidden_size}};
migraphx::shape ih_shape{migraphx::shape::float_type, {num_dirct, batch_size, hidden_size}}; migraphx::shape ih_shape{migraphx::shape::float_type, {num_dirct, batch_size, hidden_size}};
...@@ -1890,15 +1906,15 @@ struct test_gru_bidirct_hs ...@@ -1890,15 +1906,15 @@ struct test_gru_bidirct_hs
auto und = p.add_instruction(migraphx::op::undefined{}); auto und = p.add_instruction(migraphx::op::undefined{});
p.add_instruction(migraphx::op::gru{hidden_size, p.add_instruction(migraphx::op::gru{hidden_size,
{migraphx::op::sigmoid{}, migraphx::op::tanh{}}, {migraphx::op::sigmoid{}, migraphx::op::tanh{}},
migraphx::op::gru::bidirectional, migraphx::op::gru::bidirectional,
clip}, clip},
seq, seq,
w, w,
r, r,
bias, bias,
und, und,
ih); ih);
return p; return p;
} }
...@@ -1917,22 +1933,24 @@ struct test_gru_bidirct_3args_und ...@@ -1917,22 +1933,24 @@ struct test_gru_bidirct_3args_und
migraphx::program p; migraphx::program p;
migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}}; migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}};
migraphx::shape w_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, input_size}}; migraphx::shape w_shape{migraphx::shape::float_type,
migraphx::shape r_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, hidden_size}}; {num_dirct, 3 * hidden_size, input_size}};
auto seq = p.add_parameter("seq", in_shape); migraphx::shape r_shape{migraphx::shape::float_type,
auto w = p.add_parameter("w", w_shape); {num_dirct, 3 * hidden_size, hidden_size}};
auto r = p.add_parameter("r", r_shape); auto seq = p.add_parameter("seq", in_shape);
auto und = p.add_instruction(migraphx::op::undefined{}); auto w = p.add_parameter("w", w_shape);
auto r = p.add_parameter("r", r_shape);
auto und = p.add_instruction(migraphx::op::undefined{});
p.add_instruction(migraphx::op::gru{hidden_size, p.add_instruction(migraphx::op::gru{hidden_size,
{migraphx::op::sigmoid{}, migraphx::op::tanh{}}, {migraphx::op::sigmoid{}, migraphx::op::tanh{}},
migraphx::op::gru::bidirectional, migraphx::op::gru::bidirectional,
clip}, clip},
seq, seq,
w, w,
r, r,
und, und,
und, und,
und); und);
return p; return p;
} }
...@@ -1951,18 +1969,20 @@ struct test_gru_bidirct_3args ...@@ -1951,18 +1969,20 @@ struct test_gru_bidirct_3args
migraphx::program p; migraphx::program p;
migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}}; migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}};
migraphx::shape w_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, input_size}}; migraphx::shape w_shape{migraphx::shape::float_type,
migraphx::shape r_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, hidden_size}}; {num_dirct, 3 * hidden_size, input_size}};
auto seq = p.add_parameter("seq", in_shape); migraphx::shape r_shape{migraphx::shape::float_type,
auto w = p.add_parameter("w", w_shape); {num_dirct, 3 * hidden_size, hidden_size}};
auto r = p.add_parameter("r", r_shape); auto seq = p.add_parameter("seq", in_shape);
auto w = p.add_parameter("w", w_shape);
auto r = p.add_parameter("r", r_shape);
p.add_instruction(migraphx::op::gru{hidden_size, p.add_instruction(migraphx::op::gru{hidden_size,
{migraphx::op::sigmoid{}, migraphx::op::tanh{}}, {migraphx::op::sigmoid{}, migraphx::op::tanh{}},
migraphx::op::gru::bidirectional, migraphx::op::gru::bidirectional,
clip}, clip},
seq, seq,
w, w,
r); r);
return p; return p;
} }
...@@ -1981,18 +2001,20 @@ struct test_gru_bidirct_seq1 ...@@ -1981,18 +2001,20 @@ struct test_gru_bidirct_seq1
migraphx::program p; migraphx::program p;
migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}}; migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}};
migraphx::shape w_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, input_size}}; migraphx::shape w_shape{migraphx::shape::float_type,
migraphx::shape r_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, hidden_size}}; {num_dirct, 3 * hidden_size, input_size}};
auto seq = p.add_parameter("seq", in_shape); migraphx::shape r_shape{migraphx::shape::float_type,
auto w = p.add_parameter("w", w_shape); {num_dirct, 3 * hidden_size, hidden_size}};
auto r = p.add_parameter("r", r_shape); auto seq = p.add_parameter("seq", in_shape);
auto w = p.add_parameter("w", w_shape);
auto r = p.add_parameter("r", r_shape);
p.add_instruction(migraphx::op::gru{hidden_size, p.add_instruction(migraphx::op::gru{hidden_size,
{migraphx::op::sigmoid{}, migraphx::op::tanh{}}, {migraphx::op::sigmoid{}, migraphx::op::tanh{}},
migraphx::op::gru::bidirectional, migraphx::op::gru::bidirectional,
clip}, clip},
seq, seq,
w, w,
r); r);
return p; return p;
} }
...@@ -2011,18 +2033,15 @@ struct test_gru_bidirct_default_actv ...@@ -2011,18 +2033,15 @@ struct test_gru_bidirct_default_actv
migraphx::program p; migraphx::program p;
migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}}; migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}};
migraphx::shape w_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, input_size}}; migraphx::shape w_shape{migraphx::shape::float_type,
migraphx::shape r_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, hidden_size}}; {num_dirct, 3 * hidden_size, input_size}};
auto seq = p.add_parameter("seq", in_shape); migraphx::shape r_shape{migraphx::shape::float_type,
auto w = p.add_parameter("w", w_shape); {num_dirct, 3 * hidden_size, hidden_size}};
auto r = p.add_parameter("r", r_shape); auto seq = p.add_parameter("seq", in_shape);
p.add_instruction(migraphx::op::gru{hidden_size, auto w = p.add_parameter("w", w_shape);
{}, auto r = p.add_parameter("r", r_shape);
migraphx::op::gru::bidirectional, p.add_instruction(
clip}, migraphx::op::gru{hidden_size, {}, migraphx::op::gru::bidirectional, clip}, seq, w, r);
seq,
w,
r);
return p; return p;
} }
...@@ -2041,8 +2060,10 @@ struct test_gru_bidirct_default_actv1 ...@@ -2041,8 +2060,10 @@ struct test_gru_bidirct_default_actv1
migraphx::program p; migraphx::program p;
migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}}; migraphx::shape in_shape{migraphx::shape::float_type, {seq_len, batch_size, input_size}};
migraphx::shape w_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, input_size}}; migraphx::shape w_shape{migraphx::shape::float_type,
migraphx::shape r_shape{migraphx::shape::float_type, {num_dirct, 3 * hidden_size, hidden_size}}; {num_dirct, 3 * hidden_size, input_size}};
migraphx::shape r_shape{migraphx::shape::float_type,
{num_dirct, 3 * hidden_size, hidden_size}};
migraphx::shape b_shape{migraphx::shape::float_type, {num_dirct, 6 * hidden_size}}; migraphx::shape b_shape{migraphx::shape::float_type, {num_dirct, 6 * hidden_size}};
migraphx::shape ih_shape{migraphx::shape::float_type, {num_dirct, batch_size, hidden_size}}; migraphx::shape ih_shape{migraphx::shape::float_type, {num_dirct, batch_size, hidden_size}};
...@@ -2053,22 +2074,20 @@ struct test_gru_bidirct_default_actv1 ...@@ -2053,22 +2074,20 @@ struct test_gru_bidirct_default_actv1
auto ih = p.add_parameter("ih", ih_shape); auto ih = p.add_parameter("ih", ih_shape);
auto und = p.add_instruction(migraphx::op::undefined{}); auto und = p.add_instruction(migraphx::op::undefined{});
p.add_instruction(migraphx::op::gru{hidden_size, p.add_instruction(
{migraphx::op::sigmoid{}}, migraphx::op::gru{
migraphx::op::gru::bidirectional, hidden_size, {migraphx::op::sigmoid{}}, migraphx::op::gru::bidirectional, clip},
clip}, seq,
seq, w,
w, r,
r, bias,
bias, und,
und, ih);
ih);
return p; return p;
} }
}; };
int main() int main()
{ {
verify_program<test_pooling_autopad>(); verify_program<test_pooling_autopad>();
......
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