diff --git a/tflite/toco/graph_transformations/remove_trivial_concatenation_input.cc b/tflite/toco/graph_transformations/remove_trivial_concatenation_input.cc index c6a07244..22e19a8f 100644 --- a/tflite/toco/graph_transformations/remove_trivial_concatenation_input.cc +++ b/tflite/toco/graph_transformations/remove_trivial_concatenation_input.cc @@ -26,9 +26,9 @@ limitations under the License. namespace toco { -::tensorflow::Status RemoveTrivialConcatenationInput::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status RemoveTrivialConcatenationInput::Run(Model* model, + std::size_t op_index, + bool* modified) { *modified = false; // TensorFlow allows Concatenation nodes to have 0-D inputs, // and they are then treated as empty i.e. omitted from concatenation, diff --git a/tflite/toco/graph_transformations/remove_trivial_fake_quant.cc b/tflite/toco/graph_transformations/remove_trivial_fake_quant.cc index 21fa9655..3369299f 100644 --- a/tflite/toco/graph_transformations/remove_trivial_fake_quant.cc +++ b/tflite/toco/graph_transformations/remove_trivial_fake_quant.cc @@ -66,9 +66,8 @@ bool IsFakeQuantTrivial(GraphTransformation* transformation, const Model& model, } // namespace // Removes FakeQuant ops that are trivial (have no effect, are redundant, etc). -::tensorflow::Status RemoveTrivialFakeQuant::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status RemoveTrivialFakeQuant::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; const auto op_it = model->operators.begin() + op_index; auto* op = op_it->get(); diff --git a/tflite/toco/graph_transformations/remove_trivial_quantized_activation_func.cc b/tflite/toco/graph_transformations/remove_trivial_quantized_activation_func.cc index 03e26a3d..e2ae8737 100644 --- a/tflite/toco/graph_transformations/remove_trivial_quantized_activation_func.cc +++ b/tflite/toco/graph_transformations/remove_trivial_quantized_activation_func.cc @@ -95,8 +95,9 @@ bool IsTrivialFusedActivationFunc( // Attempts to remove both fused and unfused activation functions if the // quantization params indicate that the representable values fall inside the // activation range. -::tensorflow::Status RemoveTrivialQuantizedActivationFunc::Run( - Model* model, std::size_t op_index, bool* modified) { +absl::Status RemoveTrivialQuantizedActivationFunc::Run(Model* model, + std::size_t op_index, + bool* modified) { *modified = false; const auto it = model->operators.begin() + op_index; auto* op = it->get(); diff --git a/tflite/toco/graph_transformations/remove_trivial_quantized_min_max.cc b/tflite/toco/graph_transformations/remove_trivial_quantized_min_max.cc index 167a0012..fff77cb2 100644 --- a/tflite/toco/graph_transformations/remove_trivial_quantized_min_max.cc +++ b/tflite/toco/graph_transformations/remove_trivial_quantized_min_max.cc @@ -69,9 +69,9 @@ bool IsTrivialMinMax(GraphTransformation* transformation, const Model& model, // Attempts to remove min/max functions if the quantization params indicate that // the representable values fall inside the clip range. -::tensorflow::Status RemoveTrivialQuantizedMinMax::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status RemoveTrivialQuantizedMinMax::Run(Model* model, + std::size_t op_index, + bool* modified) { *modified = false; const auto it = model->operators.begin() + op_index; auto* op = it->get(); diff --git a/tflite/toco/graph_transformations/remove_trivial_reshape.cc b/tflite/toco/graph_transformations/remove_trivial_reshape.cc index 5542066d..95ae102c 100644 --- a/tflite/toco/graph_transformations/remove_trivial_reshape.cc +++ b/tflite/toco/graph_transformations/remove_trivial_reshape.cc @@ -83,9 +83,8 @@ bool IsReshapeTrivial(const Model& model, const Operator& op, } // namespace -::tensorflow::Status RemoveTrivialReshape::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status RemoveTrivialReshape::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(); diff --git a/tflite/toco/graph_transformations/remove_trivial_slice.cc b/tflite/toco/graph_transformations/remove_trivial_slice.cc index 10b49ecf..089155e5 100644 --- a/tflite/toco/graph_transformations/remove_trivial_slice.cc +++ b/tflite/toco/graph_transformations/remove_trivial_slice.cc @@ -51,8 +51,8 @@ bool IsSliceTrivial(const Model& model, const Operator& op, } // namespace -::tensorflow::Status RemoveTrivialSlice::Run(Model* model, std::size_t op_index, - bool* modified) { +absl::Status RemoveTrivialSlice::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; const auto reshape_it = model->operators.begin() + op_index; auto* slice_op = reshape_it->get(); diff --git a/tflite/toco/graph_transformations/remove_unused_op.cc b/tflite/toco/graph_transformations/remove_unused_op.cc index 9cf6c35d..feb1991b 100644 --- a/tflite/toco/graph_transformations/remove_unused_op.cc +++ b/tflite/toco/graph_transformations/remove_unused_op.cc @@ -27,8 +27,8 @@ limitations under the License. namespace toco { -::tensorflow::Status RemoveUnusedOp::Run(Model* model, std::size_t op_index, - bool* modified) { +absl::Status RemoveUnusedOp::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; const auto it = model->operators.begin() + op_index; const auto* op = it->get(); diff --git a/tflite/toco/graph_transformations/reorder_elementwise_unary.cc b/tflite/toco/graph_transformations/reorder_elementwise_unary.cc index a3f2554b..ed8c0503 100644 --- a/tflite/toco/graph_transformations/reorder_elementwise_unary.cc +++ b/tflite/toco/graph_transformations/reorder_elementwise_unary.cc @@ -66,9 +66,8 @@ bool IsMoveOperator(OperatorType optype) { // Swap elementwise operators such that all value operators occur before all // element move operators, e.g. negation then transpose. -::tensorflow::Status ReorderElementwiseUnary::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ReorderElementwiseUnary::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; const auto element_op_it = model->operators.begin() + op_index; std::unique_ptr& element_op = *element_op_it; diff --git a/tflite/toco/graph_transformations/reorder_reshape_transpose.cc b/tflite/toco/graph_transformations/reorder_reshape_transpose.cc index 8df9c310..7568c7e8 100644 --- a/tflite/toco/graph_transformations/reorder_reshape_transpose.cc +++ b/tflite/toco/graph_transformations/reorder_reshape_transpose.cc @@ -103,9 +103,8 @@ std::vector ComputeNewPerm(std::vector input_dims, // Swaps reshape-transpose to transpose-reshape whenever possible. This is // possible when the reshape does not affect memory ordering. -::tensorflow::Status ReorderReshapeTranspose::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ReorderReshapeTranspose::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; auto transpose_it = model->operators.begin() + op_index; diff --git a/tflite/toco/graph_transformations/resolve_batch_normalization.cc b/tflite/toco/graph_transformations/resolve_batch_normalization.cc index aa451a45..03ada581 100644 --- a/tflite/toco/graph_transformations/resolve_batch_normalization.cc +++ b/tflite/toco/graph_transformations/resolve_batch_normalization.cc @@ -26,9 +26,8 @@ limitations under the License. namespace toco { -::tensorflow::Status ResolveBatchNormalization::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveBatchNormalization::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; auto bn_it = model->operators.begin() + op_index; if (bn_it->get()->type != OperatorType::kBatchNormalization) { diff --git a/tflite/toco/graph_transformations/resolve_batch_to_space_nd_attributes.cc b/tflite/toco/graph_transformations/resolve_batch_to_space_nd_attributes.cc index 9264b83b..f764e069 100644 --- a/tflite/toco/graph_transformations/resolve_batch_to_space_nd_attributes.cc +++ b/tflite/toco/graph_transformations/resolve_batch_to_space_nd_attributes.cc @@ -26,9 +26,9 @@ limitations under the License. namespace toco { -::tensorflow::Status ResolveBatchToSpaceNDAttributes::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveBatchToSpaceNDAttributes::Run(Model* model, + std::size_t op_index, + bool* modified) { *modified = false; const auto op_it = model->operators.begin() + op_index; if (op_it->get()->type != OperatorType::kBatchToSpaceND) diff --git a/tflite/toco/graph_transformations/resolve_constant_binary.cc b/tflite/toco/graph_transformations/resolve_constant_binary.cc index 603db26b..0771f299 100644 --- a/tflite/toco/graph_transformations/resolve_constant_binary.cc +++ b/tflite/toco/graph_transformations/resolve_constant_binary.cc @@ -190,9 +190,9 @@ bool EvaluateBinaryOperatorOnConstantInputs(Model* model, } } // namespace -::tensorflow::Status ResolveConstantBinaryOperator::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveConstantBinaryOperator::Run(Model* model, + std::size_t op_index, + bool* modified) { *modified = false; const auto binary_it = model->operators.begin() + op_index; const auto* binary_op = binary_it->get(); diff --git a/tflite/toco/graph_transformations/resolve_constant_concatenation.cc b/tflite/toco/graph_transformations/resolve_constant_concatenation.cc index c1d35fbb..2b2ae35f 100644 --- a/tflite/toco/graph_transformations/resolve_constant_concatenation.cc +++ b/tflite/toco/graph_transformations/resolve_constant_concatenation.cc @@ -137,9 +137,9 @@ void SetMinMaxForConcatenedArray(GraphTransformation* transformation, } // namespace // Resolves the concatenation operator if all its inputs are constant arrays. -::tensorflow::Status ResolveConstantConcatenation::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveConstantConcatenation::Run(Model* model, + std::size_t op_index, + bool* modified) { *modified = false; const auto concat_it = model->operators.begin() + op_index; const auto* concat_base_op = concat_it->get(); diff --git a/tflite/toco/graph_transformations/resolve_constant_fake_quant.cc b/tflite/toco/graph_transformations/resolve_constant_fake_quant.cc index 39094ac1..7b556247 100644 --- a/tflite/toco/graph_transformations/resolve_constant_fake_quant.cc +++ b/tflite/toco/graph_transformations/resolve_constant_fake_quant.cc @@ -62,9 +62,8 @@ void GetBoundsForQuantizedDataType(ArrayDataType quantized_data_type, } } -::tensorflow::Status ResolveConstantFakeQuant::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveConstantFakeQuant::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; const auto fakequant_it = model->operators.begin() + op_index; const auto* fakequant_base_op = fakequant_it->get(); diff --git a/tflite/toco/graph_transformations/resolve_constant_fill.cc b/tflite/toco/graph_transformations/resolve_constant_fill.cc index ed63a73d..832eb482 100644 --- a/tflite/toco/graph_transformations/resolve_constant_fill.cc +++ b/tflite/toco/graph_transformations/resolve_constant_fill.cc @@ -43,9 +43,8 @@ bool ComputeFillArray(Model* model, FillOperator* op) { return true; } -::tensorflow::Status ResolveConstantFill::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveConstantFill::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; const auto fill_it = model->operators.begin() + op_index; auto* base_op = fill_it->get(); diff --git a/tflite/toco/graph_transformations/resolve_constant_gather.cc b/tflite/toco/graph_transformations/resolve_constant_gather.cc index e61c4ada..41535242 100644 --- a/tflite/toco/graph_transformations/resolve_constant_gather.cc +++ b/tflite/toco/graph_transformations/resolve_constant_gather.cc @@ -67,9 +67,8 @@ inline void Gather(const Array& input_array, const Array& coords_array, // Resolves a constant Gather operation. // This simply performs the gather and produces the output array with the // appropriate values. -::tensorflow::Status ResolveConstantGather::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveConstantGather::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; auto it = model->operators.begin() + op_index; const auto* base_op = it->get(); diff --git a/tflite/toco/graph_transformations/resolve_constant_pack.cc b/tflite/toco/graph_transformations/resolve_constant_pack.cc index 70d5c661..2090a774 100644 --- a/tflite/toco/graph_transformations/resolve_constant_pack.cc +++ b/tflite/toco/graph_transformations/resolve_constant_pack.cc @@ -51,9 +51,8 @@ void Pack(Model* model, PackOperator const& op) { } // namespace -::tensorflow::Status ResolveConstantPack::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveConstantPack::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; auto it = model->operators.begin() + op_index; const auto* base_op = it->get(); diff --git a/tflite/toco/graph_transformations/resolve_constant_random_uniform.cc b/tflite/toco/graph_transformations/resolve_constant_random_uniform.cc index 2e4896bf..a5be4cc1 100644 --- a/tflite/toco/graph_transformations/resolve_constant_random_uniform.cc +++ b/tflite/toco/graph_transformations/resolve_constant_random_uniform.cc @@ -60,9 +60,9 @@ bool ComputeRandomUniformArray(Model* model, RandomUniformOperator* op) { return true; } -::tensorflow::Status ResolveConstantRandomUniform::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveConstantRandomUniform::Run(Model* model, + std::size_t op_index, + bool* modified) { *modified = false; const auto it = model->operators.begin() + op_index; auto* base_op = it->get(); diff --git a/tflite/toco/graph_transformations/resolve_constant_range.cc b/tflite/toco/graph_transformations/resolve_constant_range.cc index 05548124..223ced49 100644 --- a/tflite/toco/graph_transformations/resolve_constant_range.cc +++ b/tflite/toco/graph_transformations/resolve_constant_range.cc @@ -43,9 +43,8 @@ void FillRangeOutput(const Array& start_array, const Array& limit_array, CHECK_EQ(buffer.data.size(), output_array->shape().dims()[0]); } -::tensorflow::Status ResolveConstantRange::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveConstantRange::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; const auto it = model->operators.begin() + op_index; auto* base_op = it->get(); diff --git a/tflite/toco/graph_transformations/resolve_constant_reshape.cc b/tflite/toco/graph_transformations/resolve_constant_reshape.cc index 94eb217d..5309492c 100644 --- a/tflite/toco/graph_transformations/resolve_constant_reshape.cc +++ b/tflite/toco/graph_transformations/resolve_constant_reshape.cc @@ -24,9 +24,8 @@ limitations under the License. namespace toco { // Resolves a constant reshape operation by copying the buffer. -::tensorflow::Status ResolveConstantReshape::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveConstantReshape::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; auto it = model->operators.begin() + op_index; const auto* base_op = it->get(); diff --git a/tflite/toco/graph_transformations/resolve_constant_select.cc b/tflite/toco/graph_transformations/resolve_constant_select.cc index 4a6fbd3d..04376873 100644 --- a/tflite/toco/graph_transformations/resolve_constant_select.cc +++ b/tflite/toco/graph_transformations/resolve_constant_select.cc @@ -29,9 +29,8 @@ namespace toco { // This implementation is looking strictly for all-or-nothing on the select // condition. It's possible to enhance this by looking per-element and possibly // producing a Mul op. -::tensorflow::Status ResolveConstantSelect::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveConstantSelect::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; auto it = model->operators.begin() + op_index; const auto* base_op = it->get(); diff --git a/tflite/toco/graph_transformations/resolve_constant_shape_or_rank.cc b/tflite/toco/graph_transformations/resolve_constant_shape_or_rank.cc index f9098a28..f3f551a5 100644 --- a/tflite/toco/graph_transformations/resolve_constant_shape_or_rank.cc +++ b/tflite/toco/graph_transformations/resolve_constant_shape_or_rank.cc @@ -21,9 +21,8 @@ limitations under the License. namespace toco { -::tensorflow::Status ResolveConstantShapeOrRank::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveConstantShapeOrRank::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; const auto it = model->operators.begin() + op_index; const auto* op = it->get(); diff --git a/tflite/toco/graph_transformations/resolve_constant_slice.cc b/tflite/toco/graph_transformations/resolve_constant_slice.cc index adabd9e9..0f4ecdba 100644 --- a/tflite/toco/graph_transformations/resolve_constant_slice.cc +++ b/tflite/toco/graph_transformations/resolve_constant_slice.cc @@ -88,9 +88,8 @@ bool Slice(SliceOperator const& op, Array const& input_array, } // namespace -::tensorflow::Status ResolveConstantSlice::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveConstantSlice::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; const auto it = model->operators.begin() + op_index; const auto* base_op = it->get(); diff --git a/tflite/toco/graph_transformations/resolve_constant_strided_slice.cc b/tflite/toco/graph_transformations/resolve_constant_strided_slice.cc index 02305bc7..c904e684 100644 --- a/tflite/toco/graph_transformations/resolve_constant_strided_slice.cc +++ b/tflite/toco/graph_transformations/resolve_constant_strided_slice.cc @@ -100,9 +100,9 @@ void StridedSlice(StridedSliceOperator const& op, Array const& input_array, } // anonymous namespace -::tensorflow::Status ResolveConstantStridedSlice::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveConstantStridedSlice::Run(Model* model, + std::size_t op_index, + bool* modified) { *modified = false; const auto it = model->operators.begin() + op_index; const auto* base_op = it->get(); diff --git a/tflite/toco/graph_transformations/resolve_constant_tile.cc b/tflite/toco/graph_transformations/resolve_constant_tile.cc index 5c568ce3..a6deb75e 100644 --- a/tflite/toco/graph_transformations/resolve_constant_tile.cc +++ b/tflite/toco/graph_transformations/resolve_constant_tile.cc @@ -100,9 +100,8 @@ inline void Tile(const Array& input_array, const Array& multiples_array, } // namespace // Resolves a constant Tile operation. -::tensorflow::Status ResolveConstantTile::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveConstantTile::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; auto it = model->operators.begin() + op_index; const auto* base_op = it->get(); diff --git a/tflite/toco/graph_transformations/resolve_constant_transpose.cc b/tflite/toco/graph_transformations/resolve_constant_transpose.cc index 0c67facb..64c1adc8 100644 --- a/tflite/toco/graph_transformations/resolve_constant_transpose.cc +++ b/tflite/toco/graph_transformations/resolve_constant_transpose.cc @@ -103,9 +103,8 @@ void Transpose(Model* model, const Array& input_array, } // namespace -::tensorflow::Status ResolveConstantTranspose::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveConstantTranspose::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; auto it = model->operators.begin() + op_index; const auto* base_op = it->get(); diff --git a/tflite/toco/graph_transformations/resolve_constant_unary.cc b/tflite/toco/graph_transformations/resolve_constant_unary.cc index 6238eb83..c605f1e5 100644 --- a/tflite/toco/graph_transformations/resolve_constant_unary.cc +++ b/tflite/toco/graph_transformations/resolve_constant_unary.cc @@ -116,9 +116,9 @@ bool CopyMinMaxFromFirstInput(const Operator& op, Model* model) { return true; } -::tensorflow::Status ResolveConstantUnaryOperator::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveConstantUnaryOperator::Run(Model* model, + std::size_t op_index, + bool* modified) { *modified = false; const auto unary_it = model->operators.begin() + op_index; const auto* unary_op = unary_it->get(); diff --git a/tflite/toco/graph_transformations/resolve_fake_quant_args_from_vars.cc b/tflite/toco/graph_transformations/resolve_fake_quant_args_from_vars.cc index 7027a276..02a231d9 100644 --- a/tflite/toco/graph_transformations/resolve_fake_quant_args_from_vars.cc +++ b/tflite/toco/graph_transformations/resolve_fake_quant_args_from_vars.cc @@ -27,9 +27,9 @@ limitations under the License. namespace toco { -::tensorflow::Status ResolveFakeQuantArgsFromVars::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveFakeQuantArgsFromVars::Run(Model* model, + std::size_t op_index, + bool* modified) { *modified = false; const auto fakequant_it = model->operators.begin() + op_index; auto* fakequant_base_op = fakequant_it->get(); diff --git a/tflite/toco/graph_transformations/resolve_gather_attributes.cc b/tflite/toco/graph_transformations/resolve_gather_attributes.cc index 15e880ee..c2e7d3ab 100644 --- a/tflite/toco/graph_transformations/resolve_gather_attributes.cc +++ b/tflite/toco/graph_transformations/resolve_gather_attributes.cc @@ -26,9 +26,8 @@ limitations under the License. namespace toco { -::tensorflow::Status ResolveGatherAttributes::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveGatherAttributes::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; auto* gather_op = model->operators[op_index].get(); if (gather_op->type != OperatorType::kGather) return absl::OkStatus(); diff --git a/tflite/toco/graph_transformations/resolve_multiply_by_zero.cc b/tflite/toco/graph_transformations/resolve_multiply_by_zero.cc index 319c08ff..25d71114 100644 --- a/tflite/toco/graph_transformations/resolve_multiply_by_zero.cc +++ b/tflite/toco/graph_transformations/resolve_multiply_by_zero.cc @@ -54,9 +54,8 @@ void FillArrayWithZeros(Array* array) { // Removes a multiplication by array of constant zeros by making the output // array to an array of constant zeros and removing the input arrays if they // are no longer needed. -::tensorflow::Status ResolveMultiplyByZero::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveMultiplyByZero::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; const auto mul_it = model->operators.begin() + op_index; auto* mul_op = mul_it->get(); diff --git a/tflite/toco/graph_transformations/resolve_pad_attributes.cc b/tflite/toco/graph_transformations/resolve_pad_attributes.cc index ece6600a..135b09c2 100644 --- a/tflite/toco/graph_transformations/resolve_pad_attributes.cc +++ b/tflite/toco/graph_transformations/resolve_pad_attributes.cc @@ -26,9 +26,8 @@ limitations under the License. namespace toco { -::tensorflow::Status ResolvePadAttributes::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolvePadAttributes::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; const auto pad_it = model->operators.begin() + op_index; auto* pad_op = pad_it->get(); diff --git a/tflite/toco/graph_transformations/resolve_padv2_attributes.cc b/tflite/toco/graph_transformations/resolve_padv2_attributes.cc index c726bc23..4bbbf895 100644 --- a/tflite/toco/graph_transformations/resolve_padv2_attributes.cc +++ b/tflite/toco/graph_transformations/resolve_padv2_attributes.cc @@ -26,9 +26,8 @@ limitations under the License. namespace toco { -::tensorflow::Status ResolvePadV2Attributes::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolvePadV2Attributes::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; const auto pad_it = model->operators.begin() + op_index; auto* pad_op = pad_it->get(); diff --git a/tflite/toco/graph_transformations/resolve_reduce_attributes.cc b/tflite/toco/graph_transformations/resolve_reduce_attributes.cc index 7d3a1610..cc2f2516 100644 --- a/tflite/toco/graph_transformations/resolve_reduce_attributes.cc +++ b/tflite/toco/graph_transformations/resolve_reduce_attributes.cc @@ -45,9 +45,8 @@ bool ResolveAttributes(Model* model, T* op) { return true; } -::tensorflow::Status ResolveReduceAttributes::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveReduceAttributes::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; Operator* op = model->operators[op_index].get(); switch (op->type) { diff --git a/tflite/toco/graph_transformations/resolve_reorder_axes.cc b/tflite/toco/graph_transformations/resolve_reorder_axes.cc index 32de03dc..52f8999b 100644 --- a/tflite/toco/graph_transformations/resolve_reorder_axes.cc +++ b/tflite/toco/graph_transformations/resolve_reorder_axes.cc @@ -82,8 +82,8 @@ void ReorderAxes(AxesOrder input_axes_order, AxesOrder output_axes_order, } } -::tensorflow::Status ResolveReorderAxes::Run(Model* model, std::size_t op_index, - bool* modified) { +absl::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(); diff --git a/tflite/toco/graph_transformations/resolve_reshape_attributes.cc b/tflite/toco/graph_transformations/resolve_reshape_attributes.cc index 19a56fc3..598fefcf 100644 --- a/tflite/toco/graph_transformations/resolve_reshape_attributes.cc +++ b/tflite/toco/graph_transformations/resolve_reshape_attributes.cc @@ -26,9 +26,8 @@ limitations under the License. namespace toco { -::tensorflow::Status ResolveReshapeAttributes::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::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(); diff --git a/tflite/toco/graph_transformations/resolve_slice_attributes.cc b/tflite/toco/graph_transformations/resolve_slice_attributes.cc index 280cf7f5..7b499dbe 100644 --- a/tflite/toco/graph_transformations/resolve_slice_attributes.cc +++ b/tflite/toco/graph_transformations/resolve_slice_attributes.cc @@ -26,9 +26,8 @@ limitations under the License. namespace toco { -::tensorflow::Status ResolveSliceAttributes::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveSliceAttributes::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; const auto slice_it = model->operators.begin() + op_index; auto* slice_op = slice_it->get(); diff --git a/tflite/toco/graph_transformations/resolve_space_to_batch_nd_attributes.cc b/tflite/toco/graph_transformations/resolve_space_to_batch_nd_attributes.cc index b8c7a923..bb845723 100644 --- a/tflite/toco/graph_transformations/resolve_space_to_batch_nd_attributes.cc +++ b/tflite/toco/graph_transformations/resolve_space_to_batch_nd_attributes.cc @@ -26,9 +26,9 @@ limitations under the License. namespace toco { -::tensorflow::Status ResolveSpaceToBatchNDAttributes::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveSpaceToBatchNDAttributes::Run(Model* model, + std::size_t op_index, + bool* modified) { *modified = false; const auto op_it = model->operators.begin() + op_index; if (op_it->get()->type != OperatorType::kSpaceToBatchND) diff --git a/tflite/toco/graph_transformations/resolve_squeeze_attributes.cc b/tflite/toco/graph_transformations/resolve_squeeze_attributes.cc index 48acacf3..9cd46931 100644 --- a/tflite/toco/graph_transformations/resolve_squeeze_attributes.cc +++ b/tflite/toco/graph_transformations/resolve_squeeze_attributes.cc @@ -27,9 +27,8 @@ limitations under the License. namespace toco { -::tensorflow::Status ResolveSqueezeAttributes::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveSqueezeAttributes::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; auto* squeeze_op = model->operators[op_index].get(); if (squeeze_op->type != OperatorType::kSqueeze) { diff --git a/tflite/toco/graph_transformations/resolve_strided_slice_attributes.cc b/tflite/toco/graph_transformations/resolve_strided_slice_attributes.cc index e17b1d1b..5ec26afd 100644 --- a/tflite/toco/graph_transformations/resolve_strided_slice_attributes.cc +++ b/tflite/toco/graph_transformations/resolve_strided_slice_attributes.cc @@ -39,9 +39,9 @@ int PadAttributeArray(Array* attribute_array, std::vector pad_values, return mask; } -::tensorflow::Status ResolveStridedSliceAttributes::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveStridedSliceAttributes::Run(Model* model, + std::size_t op_index, + bool* modified) { *modified = false; const auto slice_it = model->operators.begin() + op_index; auto* slice_op = slice_it->get(); diff --git a/tflite/toco/graph_transformations/resolve_tensorflow_concat.cc b/tflite/toco/graph_transformations/resolve_tensorflow_concat.cc index 8bd58d26..b54c5b98 100644 --- a/tflite/toco/graph_transformations/resolve_tensorflow_concat.cc +++ b/tflite/toco/graph_transformations/resolve_tensorflow_concat.cc @@ -27,9 +27,8 @@ limitations under the License. namespace toco { -::tensorflow::Status ResolveTensorFlowConcat::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveTensorFlowConcat::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; auto concat_it = model->operators.begin() + op_index; const auto* tf_concat_op = concat_it->get(); diff --git a/tflite/toco/graph_transformations/resolve_tensorflow_matmul.cc b/tflite/toco/graph_transformations/resolve_tensorflow_matmul.cc index 2e74d9a2..879f85cc 100644 --- a/tflite/toco/graph_transformations/resolve_tensorflow_matmul.cc +++ b/tflite/toco/graph_transformations/resolve_tensorflow_matmul.cc @@ -59,9 +59,8 @@ TransposeOperator* FindTransposeOpWithInput(const Model& model, } // namespace -::tensorflow::Status ResolveTensorFlowMatMul::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveTensorFlowMatMul::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; auto matmul_it = model->operators.begin() + op_index; if (matmul_it->get()->type != OperatorType::kMatMul) { diff --git a/tflite/toco/graph_transformations/resolve_tensorflow_merge.cc b/tflite/toco/graph_transformations/resolve_tensorflow_merge.cc index a951c5fb..0702660c 100644 --- a/tflite/toco/graph_transformations/resolve_tensorflow_merge.cc +++ b/tflite/toco/graph_transformations/resolve_tensorflow_merge.cc @@ -26,9 +26,8 @@ limitations under the License. namespace toco { -::tensorflow::Status ResolveTensorFlowMerge::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveTensorFlowMerge::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; const auto merge_it = model->operators.begin() + op_index; const auto* merge_op = merge_it->get(); diff --git a/tflite/toco/graph_transformations/resolve_tensorflow_switch.cc b/tflite/toco/graph_transformations/resolve_tensorflow_switch.cc index d88abca3..2853cd27 100644 --- a/tflite/toco/graph_transformations/resolve_tensorflow_switch.cc +++ b/tflite/toco/graph_transformations/resolve_tensorflow_switch.cc @@ -27,9 +27,8 @@ limitations under the License. namespace toco { -::tensorflow::Status ResolveTensorFlowSwitch::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::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(); @@ -99,7 +98,7 @@ ::tensorflow::Status ResolveTensorFlowSwitch::Run(Model* model, // Let us guard our assumption that only Merge nodes consume the outputs // of Switch nodes: if (other_op->type != OperatorType::kMerge) { - return ::tensorflow::Status( + return absl::Status( absl::StatusCode::kFailedPrecondition, ::absl::StrCat( "Found ", HelpfulOperatorTypeName(*other_op), diff --git a/tflite/toco/graph_transformations/resolve_transpose_attributes.cc b/tflite/toco/graph_transformations/resolve_transpose_attributes.cc index fd45cb4b..ca05e378 100644 --- a/tflite/toco/graph_transformations/resolve_transpose_attributes.cc +++ b/tflite/toco/graph_transformations/resolve_transpose_attributes.cc @@ -26,9 +26,8 @@ limitations under the License. namespace toco { -::tensorflow::Status ResolveTransposeAttributes::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status ResolveTransposeAttributes::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; const auto op_it = model->operators.begin() + op_index; if (op_it->get()->type != OperatorType::kTranspose) return absl::OkStatus(); diff --git a/tflite/toco/graph_transformations/shuffle_fc_weights.cc b/tflite/toco/graph_transformations/shuffle_fc_weights.cc index 2c372c27..3dcacc2b 100644 --- a/tflite/toco/graph_transformations/shuffle_fc_weights.cc +++ b/tflite/toco/graph_transformations/shuffle_fc_weights.cc @@ -29,8 +29,8 @@ limitations under the License. namespace toco { -::tensorflow::Status ShuffleFCWeights::Run(Model* model, std::size_t op_index, - bool* modified) { +absl::Status ShuffleFCWeights::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; Operator* op = model->operators[op_index].get(); if (op->type != OperatorType::kFullyConnected) { diff --git a/tflite/toco/graph_transformations/unfuse_activation_functions.cc b/tflite/toco/graph_transformations/unfuse_activation_functions.cc index 83778728..66eab3c8 100644 --- a/tflite/toco/graph_transformations/unfuse_activation_functions.cc +++ b/tflite/toco/graph_transformations/unfuse_activation_functions.cc @@ -27,9 +27,8 @@ limitations under the License. namespace toco { -::tensorflow::Status UnfuseActivationFunctions::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status UnfuseActivationFunctions::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; const auto it = model->operators.begin() + op_index; auto* op = it->get(); diff --git a/tflite/toco/graph_transformations/unpartition_embedding_lookup.cc b/tflite/toco/graph_transformations/unpartition_embedding_lookup.cc index f8ffe70f..9ebc29a8 100644 --- a/tflite/toco/graph_transformations/unpartition_embedding_lookup.cc +++ b/tflite/toco/graph_transformations/unpartition_embedding_lookup.cc @@ -26,9 +26,8 @@ limitations under the License. namespace toco { -::tensorflow::Status UnpartitionEmbeddingLookup::Run(Model* model, - std::size_t op_index, - bool* modified) { +absl::Status UnpartitionEmbeddingLookup::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; // Collapses a partitioned tf.nn.embedding_lookup back into a single Gather. // https://www.tensorflow.org/api_docs/python/tf/nn/embedding_lookup diff --git a/tflite/toco/graph_transformations/unroll_batch_matmul.cc b/tflite/toco/graph_transformations/unroll_batch_matmul.cc index 3e69608b..d8a8b149 100644 --- a/tflite/toco/graph_transformations/unroll_batch_matmul.cc +++ b/tflite/toco/graph_transformations/unroll_batch_matmul.cc @@ -137,8 +137,8 @@ TransposeOperator* TransposeInput(const std::string& input, Model* model) { // Unrolls a BatchMatMul on the batch dimension. // We need to slice each batch out of the inputs, matmul them individually, then // stack them all back together at the end. -::tensorflow::Status UnrollBatchMatMul::Run(Model* model, std::size_t op_index, - bool* modified) { +absl::Status UnrollBatchMatMul::Run(Model* model, std::size_t op_index, + bool* modified) { *modified = false; auto batch_op_it = model->operators.begin() + op_index; if (batch_op_it->get()->type != OperatorType::kBatchMatMul) {