diff options
author | Yu-Cheng Ling <ycling@google.com> | 2018-10-09 11:38:15 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-10-09 11:48:46 -0700 |
commit | 12e164d1e7c0b197f06d5d3c2ed26318b89b5e4c (patch) | |
tree | d2f0b6ba463baff8e3607575f41d3655762f3d14 /tensorflow/contrib/lite/toco/graph_transformations/resolve_reorder_axes.cc | |
parent | 931353c5f79c2d419afb3a5ecac59184c5558351 (diff) |
Return ::tensorflow::Status in Toco Graph Transformations.
PiperOrigin-RevId: 216392908
Diffstat (limited to 'tensorflow/contrib/lite/toco/graph_transformations/resolve_reorder_axes.cc')
-rw-r--r-- | tensorflow/contrib/lite/toco/graph_transformations/resolve_reorder_axes.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tensorflow/contrib/lite/toco/graph_transformations/resolve_reorder_axes.cc b/tensorflow/contrib/lite/toco/graph_transformations/resolve_reorder_axes.cc index 8e150db6fa..ee5c4810e6 100644 --- a/tensorflow/contrib/lite/toco/graph_transformations/resolve_reorder_axes.cc +++ b/tensorflow/contrib/lite/toco/graph_transformations/resolve_reorder_axes.cc @@ -78,11 +78,13 @@ void ReorderAxes(AxesOrder input_axes_order, AxesOrder output_axes_order, } } -bool ResolveReorderAxes::Run(Model* model, std::size_t op_index) { +::tensorflow::Status ResolveReorderAxes::Run(Model* model, std::size_t op_index, + bool* modified) { + *modified = false; auto it = model->operators.begin() + op_index; auto* op = it->get(); if (op->type != OperatorType::kReorderAxes) { - return false; + return ::tensorflow::Status::OK(); } auto* reorder_op = static_cast<ReorderAxesOperator*>(op); @@ -93,11 +95,11 @@ bool ResolveReorderAxes::Run(Model* model, std::size_t op_index) { auto& input_array = model->GetArray(input_array_name); auto& output_array = model->GetArray(output_array_name); if (!input_array.buffer) { - return false; + return ::tensorflow::Status::OK(); } // Yield until output dims have been resolved. if (!output_array.has_shape()) { - return false; + return ::tensorflow::Status::OK(); } // Reorder the input array dims and buffer data if (input_array.buffer->type == ArrayDataType::kFloat) { @@ -120,7 +122,8 @@ bool ResolveReorderAxes::Run(Model* model, std::size_t op_index) { DeleteOpAndArraysIfUnused(model, op); RenameArray(model, output_array_name, input_array_name); - return true; + *modified = true; + return ::tensorflow::Status::OK(); } } // namespace toco |