diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-06-14 14:18:15 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-06-14 14:25:30 -0700 |
commit | 840aeb0ce9bd0f0a1c275edc9fe6d51eff5cf33f (patch) | |
tree | ce3f002656fef2e12f28ef9b42de55acabb1d938 /tensorflow/contrib/lite/toco/export_tensorflow.cc | |
parent | d943de372a989ca6bc44058e35ba9f26591b42b4 (diff) |
Merged commit includes the following changes:
200617269 by A. Unique TensorFlower:
Internal change
--
200603378 by jpienaar:
The output of the merge should be the value's and not the original output port.
The output port of the IfOp is already taken into account by selecting the
merge node and the output of the merge should be the value used (which is the 0th
output of the merge node).
--
200601721 by A. Unique TensorFlower:
Basic support for tf.tile that multiplies a single axis.
--
200600686 by A. Unique TensorFlower:
Internal change.
--
PiperOrigin-RevId: 200617269
Diffstat (limited to 'tensorflow/contrib/lite/toco/export_tensorflow.cc')
-rw-r--r-- | tensorflow/contrib/lite/toco/export_tensorflow.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tensorflow/contrib/lite/toco/export_tensorflow.cc b/tensorflow/contrib/lite/toco/export_tensorflow.cc index c7c80ab21c..6e5e0d0137 100644 --- a/tensorflow/contrib/lite/toco/export_tensorflow.cc +++ b/tensorflow/contrib/lite/toco/export_tensorflow.cc @@ -1687,6 +1687,22 @@ void ConvertSelectOperator(const Model& model, const SelectOperator& src_op, (*sub_op->mutable_attr())["T"].set_type(data_type); } +void ConvertTileOperator(const Model& model, + const TensorFlowTileOperator& src_op, + GraphDef* tensorflow_graph) { + auto* tile_op = tensorflow_graph->add_node(); + tile_op->set_op("Tile"); + tile_op->set_name(src_op.outputs[0]); + CHECK_EQ(src_op.inputs.size(), 2); + *tile_op->add_input() = src_op.inputs[0]; + *tile_op->add_input() = src_op.inputs[1]; + const auto data_type = GetTensorFlowDataType(model, src_op.inputs[0]); + (*tile_op->mutable_attr())["T"].set_type(data_type); + const auto multiples_data_type = + GetTensorFlowDataType(model, src_op.inputs[1]); + (*tile_op->mutable_attr())["Tmultiples"].set_type(multiples_data_type); +} + void ConvertTopKV2Operator(const Model& model, const TopKV2Operator& src_op, GraphDef* tensorflow_graph) { auto* topk_op = tensorflow_graph->add_node(); @@ -1953,6 +1969,10 @@ void ConvertOperator(const Model& model, const Operator& src_op, } else if (src_op.type == OperatorType::kSelect) { ConvertSelectOperator(model, static_cast<const SelectOperator&>(src_op), tensorflow_graph); + } else if (src_op.type == OperatorType::kTensorFlowTile) { + ConvertTileOperator(model, + static_cast<const TensorFlowTileOperator&>(src_op), + tensorflow_graph); } else { LOG(FATAL) << "Unhandled operator type " << OperatorTypeName(src_op.type); } |