Skip to content

Commit

Permalink
SQUEEZE operator's input #1 can be nullptr.
Browse files Browse the repository at this point in the history
When num_squeeze_dims is zero the data pointer should be nullptr.

This addresses the following error when running NNAPIDelegate.SqueezeSimpleTest:
ANeuralNetworksModel_setOperandValue setting operand 1 which has operand type that is not fully specified

PiperOrigin-RevId: 235772184
  • Loading branch information
tensorflower-gardener committed Feb 26, 2019
1 parent 74655dd commit 231761f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tensorflow/lite/delegates/nnapi/nnapi_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ class NNAPIDelegateKernel {
// Note that we add the squeeze dimensions even if the dimensions
// were unspecified (empty), as NNAPI requires the operand.
mapping_args.builder->AddVectorInt32Operand(
builtin->squeeze_dims,
builtin->num_squeeze_dims ? builtin->squeeze_dims : nullptr,
static_cast<uint32_t>(builtin->num_squeeze_dims));
return ANEURALNETWORKS_SQUEEZE;
};
Expand Down

0 comments on commit 231761f

Please sign in to comment.