diff options
Diffstat (limited to 'tensorflow/contrib/lite/toco/graph_transformations/resolve_tensorflow_matmul.cc')
-rw-r--r-- | tensorflow/contrib/lite/toco/graph_transformations/resolve_tensorflow_matmul.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tensorflow/contrib/lite/toco/graph_transformations/resolve_tensorflow_matmul.cc b/tensorflow/contrib/lite/toco/graph_transformations/resolve_tensorflow_matmul.cc index f38203c80f..2a236d3f98 100644 --- a/tensorflow/contrib/lite/toco/graph_transformations/resolve_tensorflow_matmul.cc +++ b/tensorflow/contrib/lite/toco/graph_transformations/resolve_tensorflow_matmul.cc @@ -60,6 +60,13 @@ bool ResolveTensorFlowMatMul::Run(Model* model, std::size_t op_index) { string input_lhs = matmul_op->inputs[0]; string input_rhs = transpose_op->outputs[0]; + // Construct the new FullyConnectedOperator. + auto* fc_op = new FullyConnectedOperator; + fc_op->outputs = matmul_op->outputs; + + // Insert the newly constructed FullyConnectedOperator. + model->operators.emplace(matmul_it, fc_op) + 1; + // Find the op producing the array passed to this MatMul auto previous_op_it = model->operators.begin(); bool found = false; @@ -76,13 +83,6 @@ bool ResolveTensorFlowMatMul::Run(Model* model, std::size_t op_index) { } Operator* previous_op = (found) ? previous_op_it->get() : nullptr; - // Construct the new FullyConnectedOperator. - auto* fc_op = new FullyConnectedOperator; - fc_op->outputs = matmul_op->outputs; - - // Insert the newly constructed FullyConnectedOperator. - model->operators.emplace(matmul_it, fc_op) + 1; - // Refresh iterator. matmul_it = model->operators.begin(); for (; matmul_it != model->operators.end(); ++matmul_it) { |