summaryrefslogtreecommitdiff
path: root/nn/runtime/test/TestValidation.cpp
diff options
context:
space:
mode:
authorDavid Gross <dgross@google.com>2018-06-01 11:01:12 -0700
committerXusong Wang <xusongw@google.com>2019-01-29 10:22:18 -0800
commite3c4aae19120a8fdb870fc2ca78b38bad8de5947 (patch)
tree80bb04c18a23a97a6e62125110790b10393edc3e /nn/runtime/test/TestValidation.cpp
parentdd6832093b3eaa0361f443bedb8ba4b8db017518 (diff)
downloadml-e3c4aae19120a8fdb870fc2ca78b38bad8de5947.tar.gz
Document, support, and test unspecified dimension.
A tensor operand type with some number of unspecified dimensions is represented by setting each unspecified dimension to 0. A tensor operand type of unspecified rank is represented by setting dimensionCount to 0 and dimensions to NULL. Tensor with unspecified dimensions can not have value and can not be as model input at execution time, but is allowed for output. Enable checks and tests for it. Bug: 77234888 Bug: 73506513 Test: NeuralNetworksTest_static Change-Id: I4b6281cdd7758054a1a43ac34f39fc9c7bfead9b
Diffstat (limited to 'nn/runtime/test/TestValidation.cpp')
-rw-r--r--nn/runtime/test/TestValidation.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/nn/runtime/test/TestValidation.cpp b/nn/runtime/test/TestValidation.cpp
index f76df9f3d..2d8052a79 100644
--- a/nn/runtime/test/TestValidation.cpp
+++ b/nn/runtime/test/TestValidation.cpp
@@ -200,10 +200,10 @@ TEST_F(ValidationTestModel, AddOperand) {
EXPECT_EQ(ANeuralNetworksModel_addOperand(mModel, &quant8TypeInvalidZeroPoint),
ANEURALNETWORKS_BAD_DATA);
- uint32_t dim = 2;
+ const uint32_t dim = 2;
ANeuralNetworksOperandType invalidScalarType{
.type = ANEURALNETWORKS_INT32,
- // scalar types can only 0 dimensions.
+ // a scalar type must have 0 dimensions.
.dimensionCount = 1,
.dimensions = &dim,
};