NNAPI: Clarify behaviour of REDUCE_* ops
Add a clarification on the behaviour of REDUCE_* ops when all dimensions
of an input tensor are reduced.
Bug: 155508675
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: I3a67225c3af80af40a11362ca5d0f55350cbfa05
diff --git a/current.txt b/current.txt
index d2b7206..98089f1 100644
--- a/current.txt
+++ b/current.txt
@@ -604,6 +604,7 @@
fb382e986c10b8fbb797a8546e8f9ea6d1107bfe6f3fb7e57f6bbbf1f807a906 android.hardware.neuralnetworks@1.2::IDevice
40e71cd693de5b832325c5d8f081f2ff20a7ba2b89d401cee5b4b3eb0e241681 android.hardware.neuralnetworks@1.2::IPreparedModel
ee1a0dee5be00a6fe2d4d3270068c78016dcb194d768fe07ed894ea20904037f android.hardware.neuralnetworks@1.2::types
+882b1c042ff842d7c52a794fab60bf6c599ef6b100ce99fa1772615096811d05 android.hardware.neuralnetworks@1.2::types # b/155508675
a785a57447a81e9c130eef6904c3a5c256076c6a04588c40620ebd6fa2660d77 android.hardware.radio@1.2::types
1a6e2bd289f22931c526b21916910f1d4c436b7acb9556e4243de4ce8e6cc2e4 android.hardware.soundtrigger@2.0::ISoundTriggerHwCallback
fd65298e1e09e0e3c781ab18305920d757dbe55a3b459ce17814ec5cf6dfee99 android.hardware.wifi@1.0::IWifiP2pIface
@@ -716,6 +717,7 @@
ee9dc34b9925b8367b1111c72bd6d9d375432735e451572ca5a665d8516a7744 android.hardware.neuralnetworks@1.3::IPreparedModel
eee3430cc86c97c7b407495863d8fb61da6f1a64b7721e77b9b4909b11b174e9 android.hardware.neuralnetworks@1.3::IPreparedModelCallback
acf84925f8ee0a651f2ec547ac334034de266479b93af5434f6c1f25e66aba96 android.hardware.neuralnetworks@1.3::types
+07801d19ca8a4f20543dae6b4d0c4d8b87e5161d3c431e973a1839cb7915a666 android.hardware.neuralnetworks@1.3::types # b/155508675
b454df853441c12f6e425e8a60dd29fda20f5e6e39b93d1103e4b37495db38aa android.hardware.radio@1.5::IRadio
fcbb0742a88215ee7a6d7ce0825d253eb2b50391fc6c8c48667f9fd7f6d4549e android.hardware.radio@1.5::IRadioIndication
b809193970a91ca637a4b0184767315601d32e3ef3d5992ffbc7a8d14a14f015 android.hardware.radio@1.5::IRadioResponse
diff --git a/neuralnetworks/1.2/types.hal b/neuralnetworks/1.2/types.hal
index 2c3c599..9eff7ff 100644
--- a/neuralnetworks/1.2/types.hal
+++ b/neuralnetworks/1.2/types.hal
@@ -3872,6 +3872,8 @@
*
* Outputs:
* * 0: A tensor of the same {@link OperandType} as input0.
+ * If all dimensions are reduced and keep_dims is false, the output
+ * shape is [1].
*/
REDUCE_ALL = 75,
@@ -3897,6 +3899,8 @@
*
* Outputs:
* * 0: A tensor of the same {@link OperandType} as input0.
+ * If all dimensions are reduced and keep_dims is false, the output
+ * shape is [1].
*/
REDUCE_ANY = 76,
@@ -3924,6 +3928,8 @@
*
* Outputs:
* * 0: A tensor of the same {@link OperandType} as input0.
+ * If all dimensions are reduced and keep_dims is false, the output
+ * shape is [1].
* For a {@link OperandType::TENSOR_QUANT8_ASYMM} tensor,
* the scale and zeroPoint must be the same as input0.
*/
@@ -3953,6 +3959,8 @@
*
* Outputs:
* * 0: A tensor of the same {@link OperandType} as input0.
+ * If all dimensions are reduced and keep_dims is false, the output
+ * shape is [1].
* For a {@link OperandType::TENSOR_QUANT8_ASYMM} tensor,
* the scale and zeroPoint must be the same as input0.
*/
@@ -3980,6 +3988,8 @@
*
* Outputs:
* * 0: A tensor of the same {@link OperandType} as input0.
+ * If all dimensions are reduced and keep_dims is false, the output
+ * shape is [1].
*/
REDUCE_PROD = 79,
@@ -4005,6 +4015,8 @@
*
* Outputs:
* * 0: A tensor of the same {@link OperandType} as input0.
+ * If all dimensions are reduced and keep_dims is false, the output
+ * shape is [1].
*/
REDUCE_SUM = 80,
diff --git a/neuralnetworks/1.3/types.hal b/neuralnetworks/1.3/types.hal
index 56930c2..83cf442 100644
--- a/neuralnetworks/1.3/types.hal
+++ b/neuralnetworks/1.3/types.hal
@@ -4096,6 +4096,8 @@
*
* Outputs:
* * 0: A tensor of the same {@link OperandType} as input0.
+ * If all dimensions are reduced and keep_dims is false, the output
+ * shape is [1].
*/
REDUCE_ALL = @1.2::OperationType:REDUCE_ALL,
@@ -4121,6 +4123,8 @@
*
* Outputs:
* * 0: A tensor of the same {@link OperandType} as input0.
+ * If all dimensions are reduced and keep_dims is false, the output
+ * shape is [1].
*/
REDUCE_ANY = @1.2::OperationType:REDUCE_ANY,
@@ -4149,6 +4153,8 @@
*
* Outputs:
* * 0: A tensor of the same {@link OperandType} as input0.
+ * If all dimensions are reduced and keep_dims is false, the output
+ * shape is [1].
* For a {@link OperandType::TENSOR_QUANT8_ASYMM} and
* {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor,
* the scale and zeroPoint must be the same as input0.
@@ -4180,6 +4186,8 @@
*
* Outputs:
* * 0: A tensor of the same {@link OperandType} as input0.
+ * If all dimensions are reduced and keep_dims is false, the output
+ * shape is [1].
* For a {@link OperandType::TENSOR_QUANT8_ASYMM} and
* {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor,
* the scale and zeroPoint must be the same as input0.
@@ -4208,6 +4216,8 @@
*
* Outputs:
* * 0: A tensor of the same {@link OperandType} as input0.
+ * If all dimensions are reduced and keep_dims is false, the output
+ * shape is [1].
*/
REDUCE_PROD = @1.2::OperationType:REDUCE_PROD,
@@ -4233,6 +4243,8 @@
*
* Outputs:
* * 0: A tensor of the same {@link OperandType} as input0.
+ * If all dimensions are reduced and keep_dims is false, the output
+ * shape is [1].
*/
REDUCE_SUM = @1.2::OperationType:REDUCE_SUM,