"include/ck/utility/array.hpp" did not exist on "19c5d6e651d00d15b3909bf1ba44bf59df7f29cf"
Commit 1a37d4d2 authored by Shucai Xiao's avatar Shucai Xiao
Browse files

fix two format issues.

parent f1bce841
...@@ -798,9 +798,9 @@ struct onnx_parser ...@@ -798,9 +798,9 @@ struct onnx_parser
// For RNN, LSTM, and GRU operators, one of the input arguments // For RNN, LSTM, and GRU operators, one of the input arguments
// is prim::Undefined, and it is ignored by protobuf. We use a // is prim::Undefined, and it is ignored by protobuf. We use a
// hack to ignore this argument for these three operators // hack to ignore this argument for these three operators
const std::string op_type = node.op_type(); const std::string& op_type = node.op_type();
if((op_type == "RNN" || op_type == "LSTM" || op_type == "GRU") && if((op_type == "RNN" || op_type == "LSTM" || op_type == "GRU") &&
input.empty() == true) input.empty())
{ {
continue; continue;
} }
......
...@@ -183,10 +183,9 @@ std::vector<instruction_ref> rewrite_rnn::rnn_cell(bool is_forward, ...@@ -183,10 +183,9 @@ std::vector<instruction_ref> rewrite_rnn::rnn_cell(bool is_forward,
instruction_ref hidden_out, last_out; instruction_ref hidden_out, last_out;
std::size_t seq_len = input->get_shape().lens()[0]; std::size_t seq_len = input->get_shape().lens()[0];
long seq_index = is_forward ? 0 : seq_len - 1;
for(std::size_t i = 0; i < seq_len; i++) for(std::size_t i = 0; i < seq_len; i++)
{ {
seq_index = is_forward ? i : (seq_len - 1 - 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}}, input); auto xt = prog.insert_instruction(ins, op::slice{{0}, {seq_index}, {seq_index + 1}}, input);
xt = prog.insert_instruction(ins, op::squeeze{{0}}, xt); xt = prog.insert_instruction(ins, op::squeeze{{0}}, xt);
auto xt_wi = prog.insert_instruction(ins, op::dot{}, xt, tran_sw); auto xt_wi = prog.insert_instruction(ins, op::dot{}, xt, tran_sw);
......
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