Commit 3f3f3534 authored by Shucai Xiao's avatar Shucai Xiao
Browse files

clang format

parent 9b512b56
......@@ -934,13 +934,13 @@ std::vector<instruction_ref> rewrite_rnn::lstm_cell(bool is_forward,
auto wi = prog.insert_instruction(ins, op::slice{{0}, {0}, {hs}}, sw);
auto tran_wi = prog.insert_instruction(ins, op::transpose{perm}, wi);
auto wo = prog.insert_instruction(ins, op::slice{{0}, {hs}, {2*hs}}, sw);
auto wo = prog.insert_instruction(ins, op::slice{{0}, {hs}, {2 * hs}}, sw);
auto tran_wo = prog.insert_instruction(ins, op::transpose{perm}, wo);
auto wf = prog.insert_instruction(ins, op::slice{{0}, {2*hs}, {3*hs}}, sw);
auto wf = prog.insert_instruction(ins, op::slice{{0}, {2 * hs}, {3 * hs}}, sw);
auto tran_wf = prog.insert_instruction(ins, op::transpose{perm}, wf);
auto wc = prog.insert_instruction(ins, op::slice{{0}, {3*hs}, {4*hs}}, sw);
auto wc = prog.insert_instruction(ins, op::slice{{0}, {3 * hs}, {4 * hs}}, sw);
auto tran_wc = prog.insert_instruction(ins, op::transpose{perm}, wc);
// r matrix
......@@ -948,13 +948,13 @@ std::vector<instruction_ref> rewrite_rnn::lstm_cell(bool is_forward,
auto ri = prog.insert_instruction(ins, op::slice{{0}, {0}, {hs}}, sr);
auto tran_ri = prog.insert_instruction(ins, op::transpose{perm}, ri);
auto ro = prog.insert_instruction(ins, op::slice{{0}, {hs}, {2*hs}}, sr);
auto ro = prog.insert_instruction(ins, op::slice{{0}, {hs}, {2 * hs}}, sr);
auto tran_ro = prog.insert_instruction(ins, op::transpose{perm}, ro);
auto rf = prog.insert_instruction(ins, op::slice{{0}, {2*hs}, {3*hs}}, sr);
auto rf = prog.insert_instruction(ins, op::slice{{0}, {2 * hs}, {3 * hs}}, sr);
auto tran_rf = prog.insert_instruction(ins, op::transpose{perm}, rf);
auto rc = prog.insert_instruction(ins, op::slice{{0}, {3*hs}, {4*hs}}, sr);
auto rc = prog.insert_instruction(ins, op::slice{{0}, {3 * hs}, {4 * hs}}, sr);
auto tran_rc = prog.insert_instruction(ins, op::transpose{perm}, rc);
// initial hidden state
......@@ -969,13 +969,13 @@ std::vector<instruction_ref> rewrite_rnn::lstm_cell(bool is_forward,
pphi = prog.insert_instruction(ins, op::slice{{0}, {0}, {hs}}, spph);
pphi_bcst = prog.insert_instruction(ins, op::broadcast{1, ic_shape}, pphi);
ppho = prog.insert_instruction(ins, op::slice{{0}, {hs}, {2*hs}}, spph);
ppho = prog.insert_instruction(ins, op::slice{{0}, {hs}, {2 * hs}}, spph);
ppho_bcst = prog.insert_instruction(ins, op::broadcast{1, ic_shape}, ppho);
pphf = prog.insert_instruction(ins, op::slice{{0}, {2*hs}, {3*hs}}, spph);
pphf = prog.insert_instruction(ins, op::slice{{0}, {2 * hs}, {3 * hs}}, spph);
pphf_bcst = prog.insert_instruction(ins, op::broadcast{1, ic_shape}, pphf);
for (long i = 0; i < seq_len; ++i)
for(long i = 0; i < seq_len; ++i)
{
long seq_index = is_forward ? i : (seq_len - 1 - i);
auto xt = prog.insert_instruction(ins, op::slice{{0}, {seq_index}, {seq_index + 1}}, seq);
......@@ -986,7 +986,6 @@ std::vector<instruction_ref> rewrite_rnn::lstm_cell(bool is_forward,
auto ht_ri = prog.insert_instruction(ins, op::dot{}, sih, tran_ri);
auto pphi_ct = prog.insert_instruction(ins, op::mul{}, pphi_bcst, sic);
}
}
std::vector<operation> rewrite_rnn::lstm_actv_funcs(instruction_ref ins) const
......
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