aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/lite/toco/graph_transformations/resolve_reshape_attributes.cc
diff options
context:
space:
mode:
authorGravatar Yu-Cheng Ling <ycling@google.com>2018-10-09 11:38:15 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-10-09 11:48:46 -0700
commit12e164d1e7c0b197f06d5d3c2ed26318b89b5e4c (patch)
treed2f0b6ba463baff8e3607575f41d3655762f3d14 /tensorflow/contrib/lite/toco/graph_transformations/resolve_reshape_attributes.cc
parent931353c5f79c2d419afb3a5ecac59184c5558351 (diff)
Return ::tensorflow::Status in Toco Graph Transformations.
PiperOrigin-RevId: 216392908
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.cc14
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