aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/lite/toco/graph_transformations/resolve_tensorflow_switch.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/contrib/lite/toco/graph_transformations/resolve_tensorflow_switch.cc')
-rw-r--r--tensorflow/contrib/lite/toco/graph_transformations/resolve_tensorflow_switch.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/tensorflow/contrib/lite/toco/graph_transformations/resolve_tensorflow_switch.cc b/tensorflow/contrib/lite/toco/graph_transformations/resolve_tensorflow_switch.cc
index 8bef440afd..e215981b42 100644
--- a/tensorflow/contrib/lite/toco/graph_transformations/resolve_tensorflow_switch.cc
+++ b/tensorflow/contrib/lite/toco/graph_transformations/resolve_tensorflow_switch.cc
@@ -24,11 +24,14 @@ limitations under the License.
namespace toco {
-bool ResolveTensorFlowSwitch::Run(Model* model, std::size_t op_index) {
+::tensorflow::Status ResolveTensorFlowSwitch::Run(Model* model,
+ std::size_t op_index,
+ bool* modified) {
+ *modified = false;
const auto switch_it = model->operators.begin() + op_index;
const auto* switch_op = switch_it->get();
if (switch_op->type != OperatorType::kSwitch) {
- return false;
+ return ::tensorflow::Status::OK();
}
CHECK_EQ(switch_op->inputs.size(), 2);
@@ -40,7 +43,7 @@ bool ResolveTensorFlowSwitch::Run(Model* model, std::size_t op_index) {
AddMessageF(
"Waiting for the boolean predicate of %s to be resolved to a constant",
LogName(*switch_op));
- return false;
+ return ::tensorflow::Status::OK();
}
// The predicate should be boolean, and should consist of a single value.
@@ -119,7 +122,8 @@ bool ResolveTensorFlowSwitch::Run(Model* model, std::size_t op_index) {
// Remove the switch node itself.
AddMessageF("Removing already-resolved %s", LogName(*switch_op));
model->operators.erase(switch_it);
- return true;
+ *modified = true;
+ return ::tensorflow::Status::OK();
}
} // namespace toco