diff options
author | 2018-02-01 13:13:12 -0800 | |
---|---|---|
committer | 2018-02-01 17:24:07 -0800 | |
commit | c460a245a25467a66d7319544afb92407057b424 (patch) | |
tree | 1bed346fdb5a75593d4c1ff4d20608f9343c00eb | |
parent | 1453d4c61178dbb4dea9e48790ea8fd7c58cd1d5 (diff) |
Fix segfault when Softmax is first in graph
PiperOrigin-RevId: 184183730
-rw-r--r-- | tensorflow/contrib/lite/toco/export_tensorflow.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tensorflow/contrib/lite/toco/export_tensorflow.cc b/tensorflow/contrib/lite/toco/export_tensorflow.cc index 529df3cd2e..4c70b01a9d 100644 --- a/tensorflow/contrib/lite/toco/export_tensorflow.cc +++ b/tensorflow/contrib/lite/toco/export_tensorflow.cc @@ -621,7 +621,8 @@ void ConvertSoftmaxOperator(const Model& model, const SoftmaxOperator& src_op, GraphDef* tensorflow_graph) { string softmax_input; Operator* providing_op = GetOpWithOutput(model, src_op.inputs[0]); - if (providing_op->type == OperatorType::kTensorFlowReshape) { + if (providing_op != nullptr && + providing_op->type == OperatorType::kTensorFlowReshape) { softmax_input = src_op.inputs[0]; } else { // Insert a reshape operator that reduces the dimensions down to the 2 that |