diff options
author | 2017-12-08 13:25:49 -0800 | |
---|---|---|
committer | 2017-12-08 13:30:15 -0800 | |
commit | dc04e89bc6f0421bf77ac69f21c1f2f57618f53c (patch) | |
tree | 49b05183e6a6dd2e8a5afff97a0fe35615de1127 /tensorflow/contrib/lite/toco/graph_transformations/resolve_strided_slice_attributes.cc | |
parent | 1afc6149ed0649971d83fe8e9748056285dcf332 (diff) |
Adding support for new TensorFlow operators. Also adding a transformation to convert an ExpandDims into a Reshape op.
PiperOrigin-RevId: 178418377
Diffstat (limited to 'tensorflow/contrib/lite/toco/graph_transformations/resolve_strided_slice_attributes.cc')
-rw-r--r-- | tensorflow/contrib/lite/toco/graph_transformations/resolve_strided_slice_attributes.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tensorflow/contrib/lite/toco/graph_transformations/resolve_strided_slice_attributes.cc b/tensorflow/contrib/lite/toco/graph_transformations/resolve_strided_slice_attributes.cc index 851511268d..97946182ef 100644 --- a/tensorflow/contrib/lite/toco/graph_transformations/resolve_strided_slice_attributes.cc +++ b/tensorflow/contrib/lite/toco/graph_transformations/resolve_strided_slice_attributes.cc @@ -39,6 +39,10 @@ bool ResolveStridedSliceAttributes::Run(Model* model, std::size_t op_index) { const auto& start_array = *model->arrays[op->inputs[1]]; if (!start_array.has_shape()) return false; + if (toco::RequiredBufferSizeForShape(start_array.shape()) != 4) { + // Only 4D arrays are supported for now. + return false; + } const auto& stop_array = *model->arrays[op->inputs[2]]; if (!stop_array.has_shape()) return false; |