Merge "Fix problem passing null optional operands." into oc-mr1-dev
diff --git a/neuralnetworks/1.0/types.hal b/neuralnetworks/1.0/types.hal
index 54ed402..a645393 100644
--- a/neuralnetworks/1.0/types.hal
+++ b/neuralnetworks/1.0/types.hal
@@ -990,6 +990,12 @@
* The operand is a constant that was specified via a Memory object.
*/
CONSTANT_REFERENCE,
+
+ /**
+ * The operand does not have a value. This is valid only for optional arguments
+ * of operations.
+ */
+ NO_VALUE,
};
/**
@@ -1084,8 +1090,7 @@
/**
* Quantized zero-point offset of the operand.
*
- * Only applicable if the operand is of type TENSOR_QUANT8_ASYMM or
- * TENSOR_INT32.
+ * Only applicable if the operand is of type TENSOR_QUANT8_ASYMM.
*/
int32_t zeroPoint;
@@ -1096,7 +1101,7 @@
/**
* Where to find the data for this operand.
- * If the lifetime is TEMPORARY_VARIABLE, MODEL_INPUT, or MODEL_OUTPUT:
+ * If the lifetime is TEMPORARY_VARIABLE, MODEL_INPUT, MODEL_OUTPUT, or NO_VALUE:
* - All the fields will be 0.
* If the lifetime is CONSTANT_COPY:
* - location.poolIndex is 0.
@@ -1190,6 +1195,13 @@
*/
struct RequestArgument {
/**
+ * If true, the argument does not have a value. This can be used for operations
+ * that take optional arguments. If true, the fields of location are set to 0 and
+ * the dimensions vector is left empty.
+ */
+ bool hasNoValue;
+
+ /**
* The location within one of the memory pools passed in the Request.
*/
DataLocation location;