Add rank checks to validation functions
The change adds rank checks to validation of operations that only
support tensors of rank 4 or less. This requirement comes from legacy TF
Lite code and is likely to be relaxed in the future to be on par with TF
Lite.
Adding the checks to validation is benefitial for the TF Lite delegate
since in case of a validation error NNAPI node will be fully rejected by
the delegation but execution error will cause TF Lite to run NNAPI node
during every invocation only to receive an error and do the calculation
using CPU implementation.
Bug: 139957496
Test: NNTest_static
Change-Id: I5cc4c48e775826a237d5ac54c3d2078254bd17a2
15 files changed