diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-10-04 11:04:41 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-10-04 11:09:04 -0700 |
commit | e1a8f4b03df2ef84538c01788b6043eb723cd046 (patch) | |
tree | d0712add4ef35a7067c5c57552811128615f9e92 /tensorflow/contrib | |
parent | 5e9bd578802fcfff5de9729332eea4ae85c05c9e (diff) |
Automated rollback of commit 8dc7bc7764150253c03a666eee84fc48f867d6a2
PiperOrigin-RevId: 215768310
Diffstat (limited to 'tensorflow/contrib')
16 files changed, 0 insertions, 122 deletions
diff --git a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_binary.cc b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_binary.cc index 3e57d3f467..f7e5aa6609 100644 --- a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_binary.cc +++ b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_binary.cc @@ -191,14 +191,6 @@ void EvaluateBinaryOperatorOnConstantInputs(Model* model, bool ResolveConstantBinaryOperator::Run(Model* model, std::size_t op_index) { const auto binary_it = model->operators.begin() + op_index; const auto* binary_op = binary_it->get(); - - // If the output of this op is a non-discardable array such as an input_array - // or a state array of the model, then this is a job for RemoveUnusedOp, not - // for constants-propagation. - if (!IsDiscardableArray(*model, binary_op->outputs[0])) { - return false; - } - // Test for binary ops of types that we know how to resolve if (binary_op->type != OperatorType::kAdd && binary_op->type != OperatorType::kMul && diff --git a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_concatenation.cc b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_concatenation.cc index c6c5035a51..d916ae0ddf 100644 --- a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_concatenation.cc +++ b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_concatenation.cc @@ -144,13 +144,6 @@ bool ResolveConstantConcatenation::Run(Model* model, std::size_t op_index) { const auto* concat_op = static_cast<const ConcatenationOperator*>(concat_base_op); - // If the output of this op is a non-discardable array such as an input_array - // or a state array of the model, then this is a job for RemoveUnusedOp, not - // for constants-propagation. - if (!IsDiscardableArray(*model, concat_op->outputs[0])) { - return false; - } - for (const string& input_name : concat_op->inputs) { // We only expect constant unquantized arrays as input, otherwise we return. // We also make sure the shapes of the input arrays are known and they are diff --git a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_fake_quant.cc b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_fake_quant.cc index 3d797533c9..f5f2f77460 100644 --- a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_fake_quant.cc +++ b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_fake_quant.cc @@ -69,13 +69,6 @@ bool ResolveConstantFakeQuant::Run(Model* model, std::size_t op_index) { const auto* fakequant_op = static_cast<const FakeQuantOperator*>(fakequant_base_op); - // If the output of this op is a non-discardable array such as an input_array - // or a state array of the model, then this is a job for RemoveUnusedOp, not - // for constants-propagation. - if (!IsDiscardableArray(*model, fakequant_op->outputs[0])) { - return false; - } - // Yield until the fakequant MinMax has been resolved. if (!fakequant_op->minmax) { return false; diff --git a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_fill.cc b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_fill.cc index 2cb1e64f3a..f6f95481b5 100644 --- a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_fill.cc +++ b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_fill.cc @@ -52,13 +52,6 @@ bool ResolveConstantFill::Run(Model* model, std::size_t op_index) { CHECK_EQ(op->inputs.size(), 2); CHECK_EQ(op->outputs.size(), 1); - // If the output of this op is a non-discardable array such as an input_array - // or a state array of the model, then this is a job for RemoveUnusedOp, not - // for constants-propagation. - if (!IsDiscardableArray(*model, op->outputs[0])) { - return false; - } - auto& output_array = model->GetArray(op->outputs[0]); if (output_array.data_type == ArrayDataType::kNone) { // Yield until the output type has been set by PropagateArrayDataTypes diff --git a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_gather.cc b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_gather.cc index 4dfe203a25..36d7dad0ce 100644 --- a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_gather.cc +++ b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_gather.cc @@ -71,14 +71,6 @@ bool ResolveConstantGather::Run(Model* model, std::size_t op_index) { CHECK_GE(op->inputs.size(), 2); CHECK_EQ(op->outputs.size(), 1); - - // If the output of this op is a non-discardable array such as an input_array - // or a state array of the model, then this is a job for RemoveUnusedOp, not - // for constants-propagation. - if (!IsDiscardableArray(*model, op->outputs[0])) { - return false; - } - auto& output_array = model->GetArray(op->outputs[0]); if (output_array.data_type == ArrayDataType::kNone) { // Yield until the output type has been set by PropagateArrayDataTypes. diff --git a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_pack.cc b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_pack.cc index 6f44025dd4..e86616574d 100644 --- a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_pack.cc +++ b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_pack.cc @@ -59,14 +59,6 @@ bool ResolveConstantPack::Run(Model* model, std::size_t op_index) { CHECK_GE(op->inputs.size(), 1); CHECK_EQ(op->outputs.size(), 1); - - // If the output of this op is a non-discardable array such as an input_array - // or a state array of the model, then this is a job for RemoveUnusedOp, not - // for constants-propagation. - if (!IsDiscardableArray(*model, op->outputs[0])) { - return false; - } - auto& output_array = model->GetArray(op->outputs[0]); if (output_array.data_type == ArrayDataType::kNone) { // Yield until the output type has been set by PropagateArrayDataTypes diff --git a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_random_uniform.cc b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_random_uniform.cc index c9f2b95d09..88d06d7dc7 100644 --- a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_random_uniform.cc +++ b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_random_uniform.cc @@ -70,13 +70,6 @@ bool ResolveConstantRandomUniform::Run(Model* model, std::size_t op_index) { CHECK_EQ(op->inputs.size(), 1); CHECK_EQ(op->outputs.size(), 1); - // If the output of this op is a non-discardable array such as an input_array - // or a state array of the model, then this is a job for RemoveUnusedOp, not - // for constants-propagation. - if (!IsDiscardableArray(*model, op->outputs[0])) { - return false; - } - auto& output_array = model->GetArray(op->outputs[0]); if (output_array.data_type == ArrayDataType::kNone) { // Yield until the output type has been set by PropagateArrayDataTypes diff --git a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_range.cc b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_range.cc index e347286dd4..1a0ba9e2bc 100644 --- a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_range.cc +++ b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_range.cc @@ -28,14 +28,6 @@ bool ResolveConstantRange::Run(Model* model, std::size_t op_index) { auto* op = static_cast<RangeOperator*>(base_op); CHECK_EQ(op->inputs.size(), 3); - - // If the output of this op is a non-discardable array such as an input_array - // or a state array of the model, then this is a job for RemoveUnusedOp, not - // for constants-propagation. - if (!IsDiscardableArray(*model, op->outputs[0])) { - return false; - } - const auto& start_array = model->GetArray(op->inputs[0]); if (!start_array.has_shape()) { // Yield until all input dims have been resolved. diff --git a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_reshape.cc b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_reshape.cc index bfdaa8aafd..a6f665b5f0 100644 --- a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_reshape.cc +++ b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_reshape.cc @@ -33,13 +33,6 @@ bool ResolveConstantReshape::Run(Model* model, std::size_t op_index) { CHECK_EQ(op->inputs.size(), 2); CHECK_EQ(op->outputs.size(), 1); - // If the output of this op is a non-discardable array such as an input_array - // or a state array of the model, then this is a job for RemoveUnusedOp, not - // for constants-propagation. - if (!IsDiscardableArray(*model, op->outputs[0])) { - return false; - } - // We require constant inputs. if (!IsConstantParameterArray(*model, op->inputs[0]) || !IsConstantParameterArray(*model, op->inputs[1])) { diff --git a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_select.cc b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_select.cc index 3a95d39cd4..e880a3f44d 100644 --- a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_select.cc +++ b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_select.cc @@ -37,14 +37,6 @@ bool ResolveConstantSelect::Run(Model* model, std::size_t op_index) { CHECK_GE(op->inputs.size(), 3); CHECK_EQ(op->outputs.size(), 1); - - // If the output of this op is a non-discardable array such as an input_array - // or a state array of the model, then this is a job for RemoveUnusedOp, not - // for constants-propagation. - if (!IsDiscardableArray(*model, op->outputs[0])) { - return false; - } - auto& output_array = model->GetArray(op->outputs[0]); if (output_array.data_type == ArrayDataType::kNone) { // Yield until the output type has been set by PropagateArrayDataTypes. diff --git a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_shape_or_rank.cc b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_shape_or_rank.cc index 452bef1f16..8a0e3e8995 100644 --- a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_shape_or_rank.cc +++ b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_shape_or_rank.cc @@ -27,14 +27,6 @@ bool ResolveConstantShapeOrRank::Run(Model* model, std::size_t op_index) { } CHECK_EQ(op->outputs.size(), 1); - - // If the output of this op is a non-discardable array such as an input_array - // or a state array of the model, then this is a job for RemoveUnusedOp, not - // for constants-propagation. - if (!IsDiscardableArray(*model, op->outputs[0])) { - return false; - } - auto& output_array = model->GetArray(op->outputs[0]); if (output_array.data_type == ArrayDataType::kNone) { // Yield until the output type has been resolved diff --git a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_slice.cc b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_slice.cc index 58d6797e1c..b35c3e19c4 100644 --- a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_slice.cc +++ b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_slice.cc @@ -96,14 +96,6 @@ bool ResolveConstantSlice::Run(Model* model, std::size_t op_index) { const SliceOperator* op = static_cast<const SliceOperator*>(base_op); CHECK_EQ(op->outputs.size(), 1); - - // If the output of this op is a non-discardable array such as an input_array - // or a state array of the model, then this is a job for RemoveUnusedOp, not - // for constants-propagation. - if (!IsDiscardableArray(*model, op->outputs[0])) { - return false; - } - auto& output_array = model->GetArray(op->outputs[0]); if (output_array.data_type == ArrayDataType::kNone) { // Yield until the output type has been set by PropagateArrayDataTypes. diff --git a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_strided_slice.cc b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_strided_slice.cc index e275447a0c..8853ed87e6 100644 --- a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_strided_slice.cc +++ b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_strided_slice.cc @@ -114,14 +114,6 @@ bool ResolveConstantStridedSlice::Run(Model* model, std::size_t op_index) { static_cast<const StridedSliceOperator*>(base_op); CHECK_EQ(op->outputs.size(), 1); - - // If the output of this op is a non-discardable array such as an input_array - // or a state array of the model, then this is a job for RemoveUnusedOp, not - // for constants-propagation. - if (!IsDiscardableArray(*model, op->outputs[0])) { - return false; - } - auto& output_array = model->GetArray(op->outputs[0]); if (output_array.data_type == ArrayDataType::kNone) { // Yield until the output type has been set by PropagateArrayDataTypes diff --git a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_tile.cc b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_tile.cc index 378a38f14b..5cfa1a5582 100644 --- a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_tile.cc +++ b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_tile.cc @@ -105,13 +105,6 @@ bool ResolveConstantTile::Run(Model* model, std::size_t op_index) { } const auto* op = static_cast<const TensorFlowTileOperator*>(base_op); - // If the output of this op is a non-discardable array such as an input_array - // or a state array of the model, then this is a job for RemoveUnusedOp, not - // for constants-propagation. - if (!IsDiscardableArray(*model, op->outputs[0])) { - return false; - } - CHECK_GE(op->inputs.size(), 2); CHECK_EQ(op->outputs.size(), 1); auto& output_array = model->GetArray(op->outputs[0]); diff --git a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_transpose.cc b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_transpose.cc index 5d3f4a6240..fe15dfa06f 100644 --- a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_transpose.cc +++ b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_transpose.cc @@ -111,14 +111,6 @@ bool ResolveConstantTranspose::Run(Model* model, std::size_t op_index) { CHECK_EQ(op->inputs.size(), 2); CHECK_EQ(op->outputs.size(), 1); - - // If the output of this op is a non-discardable array such as an input_array - // or a state array of the model, then this is a job for RemoveUnusedOp, not - // for constants-propagation. - if (!IsDiscardableArray(*model, op->outputs[0])) { - return false; - } - auto& output_array = model->GetArray(op->outputs[0]); if (output_array.data_type == ArrayDataType::kNone) { // Yield until the output type has been set by PropagateArrayDataTypes. diff --git a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_unary.cc b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_unary.cc index e35ed0898b..c698a9567a 100644 --- a/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_unary.cc +++ b/tensorflow/contrib/lite/toco/graph_transformations/resolve_constant_unary.cc @@ -48,14 +48,6 @@ bool CopyMinMaxFromFirstInput(const Operator& op, Model* model) { bool ResolveConstantUnaryOperator::Run(Model* model, std::size_t op_index) { const auto unary_it = model->operators.begin() + op_index; const auto* unary_op = unary_it->get(); - - // If the output of this op is a non-discardable array such as an input_array - // or a state array of the model, then this is a job for RemoveUnusedOp, not - // for constants-propagation. - if (!IsDiscardableArray(*model, unary_op->outputs[0])) { - return false; - } - // Test for unary ops of types that we know how to resolve. switch (unary_op->type) { case OperatorType::kCast: |