Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tensorflow/lite/delegates/nnapi/nnapi_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1863,6 +1863,9 @@ bool NNAPIDelegateKernel::Validate(
const auto& input = context->tensors[node->outputs->data[0]];
ExpectIsFloatOrQuant8Operator(context, node, &val_ctx);
const int input_rank = input.dims->size;
for(auto d : input.dims) {
Expect(d < 65535, NNAPIValidationFailureType::kUnsupportedOperandSize, "Input dimension larger than 65535", &val_ctx);
}
Expect(input_rank <= 4,
NNAPIValidationFailureType::kUnsupportedOperandRank,
"Input rank should be <= 4", &val_ctx);
Expand Down