diff options
Diffstat (limited to 'tensorflow/contrib/lite/toco/graph_transformations/resolve_reshape_attributes.cc')
-rw-r--r-- | tensorflow/contrib/lite/toco/graph_transformations/resolve_reshape_attributes.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tensorflow/contrib/lite/toco/graph_transformations/resolve_reshape_attributes.cc b/tensorflow/contrib/lite/toco/graph_transformations/resolve_reshape_attributes.cc index b615c9a545..7b7a59264f 100644 --- a/tensorflow/contrib/lite/toco/graph_transformations/resolve_reshape_attributes.cc +++ b/tensorflow/contrib/lite/toco/graph_transformations/resolve_reshape_attributes.cc @@ -25,25 +25,29 @@ limitations under the License. namespace toco { -bool ResolveReshapeAttributes::Run(Model* model, std::size_t op_index) { +::tensorflow::Status ResolveReshapeAttributes::Run(Model* model, + std::size_t op_index, + bool* modified) { + *modified = false; const auto reshape_it = model->operators.begin() + op_index; auto* reshape_op = reshape_it->get(); if (reshape_op->type != OperatorType::kReshape) { - return false; + return ::tensorflow::Status::OK(); } auto* op = static_cast<TensorFlowReshapeOperator*>(reshape_op); - if (!op->shape.empty()) return false; + if (!op->shape.empty()) return ::tensorflow::Status::OK(); if (IsConstantParameterArray(*model, reshape_op->inputs[1])) { const auto& constant_input_array = model->GetArray(reshape_op->inputs[1]); op->shape = constant_input_array.GetBuffer<ArrayDataType::kInt32>().data; } - if (op->shape.empty()) return false; + if (op->shape.empty()) return ::tensorflow::Status::OK(); - return true; + *modified = true; + return ::tensorflow::Status::OK(); } } // namespace toco |