summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Gross2018-06-06 13:22:50 -0500
committerAndroid (Google) Code Review2018-06-06 13:22:50 -0500
commit0be954949ddf098fb9ab28c523b04aceeb575323 (patch)
tree2fd9a33642bef18aa3362d2c80c3b63160844408
parent62e310cbfdd89d661b7d5550df29075e4eb911ad (diff)
parent8939b5df129777b6597f5f973552ae99ab956b35 (diff)
downloadplatform-hardware-interfaces-0be954949ddf098fb9ab28c523b04aceeb575323.tar.gz
platform-hardware-interfaces-0be954949ddf098fb9ab28c523b04aceeb575323.tar.xz
platform-hardware-interfaces-0be954949ddf098fb9ab28c523b04aceeb575323.zip
Merge "Document unspecified dimensions." into pi-dev
-rw-r--r--current.txt2
-rw-r--r--neuralnetworks/1.0/types.hal52
2 files changed, 49 insertions, 5 deletions
diff --git a/current.txt b/current.txt
index 05e8a1fd..e519eb0b 100644
--- a/current.txt
+++ b/current.txt
@@ -267,7 +267,7 @@ bd33ac23c57b4a07632691d2191bc2c93930f57e62f4ccf459748fdaa5c0f480 android.hardwar
267ad8a28ca3a5549fb9bc24cf5f80ac8f660cc27be885210d76266780aa52ddb8d android.hardware.keymaster@3.0::types 267ad8a28ca3a5549fb9bc24cf5f80ac8f660cc27be885210d76266780aa52ddb8d android.hardware.keymaster@3.0::types
2685804ca86611d72e5481f022b3a0c1b334217f2e4988dad25730c42af2d1f4d1c android.hardware.neuralnetworks@1.0::IDevice 2685804ca86611d72e5481f022b3a0c1b334217f2e4988dad25730c42af2d1f4d1c android.hardware.neuralnetworks@1.0::IDevice
26912e8dca4ab7d8aadd0ef8f1b438021938e2396139e85db2ed65783b08800aa52 android.hardware.neuralnetworks@1.0::IExecutionCallback 26912e8dca4ab7d8aadd0ef8f1b438021938e2396139e85db2ed65783b08800aa52 android.hardware.neuralnetworks@1.0::IExecutionCallback
27018e6885e184fe48401c2c53f1d1b8bfb07240f40c81ae6b9d2e336fca6efdbb7 android.hardware.neuralnetworks@1.0::types 27086b77e06da756a76aa3685be88765852dd982a86d8c90b8b4fc1130ed4184c8f android.hardware.neuralnetworks@1.0::types
271d4840db8efabdf1e4b344fc981cd36e5fe81a39aff6e199f6d06c1c8da413efd android.hardware.radio@1.0::types 271d4840db8efabdf1e4b344fc981cd36e5fe81a39aff6e199f6d06c1c8da413efd android.hardware.radio@1.0::types
272f96cbc59dfe16c8d0c2a7e06db24d8738a6328b6e90f7b8e1640ea2b4600debd android.hardware.radio@1.1::ISap 272f96cbc59dfe16c8d0c2a7e06db24d8738a6328b6e90f7b8e1640ea2b4600debd android.hardware.radio@1.1::ISap
2732d86929794795e5c70f4fdb5073485fd05835c9c6f496116687c3d9f32e6df3e android.hardware.radio@1.2::ISap 2732d86929794795e5c70f4fdb5073485fd05835c9c6f496116687c3d9f32e6df3e android.hardware.radio@1.2::ISap
diff --git a/neuralnetworks/1.0/types.hal b/neuralnetworks/1.0/types.hal
index 4efa13ad..1ae1726c 100644
--- a/neuralnetworks/1.0/types.hal
+++ b/neuralnetworks/1.0/types.hal
@@ -1519,6 +1519,41 @@ struct Operand {
1519 1519
1520 /** 1520 /**
1521 * Dimensions of the operand. 1521 * Dimensions of the operand.
1522 *
1523 * For a scalar operand, dimensions.size() must be 0.
1524 *
1525 * For a tensor operand, dimensions.size() must be at least 1;
1526 * however, any of the dimensions may be unspecified.
1527 *
1528 * A tensor operand with all dimensions specified has "fully
1529 * specified" dimensions. Whenever possible (i.e., whenever the
1530 * dimensions are known at model construction time), a tensor
1531 * operand should have (but is not required to have) fully
1532 * specified dimensions, in order to enable the best possible
1533 * performance.
1534 *
1535 * If a tensor operand's dimensions are not fully specified, the
1536 * dimensions of the operand are deduced from the operand
1537 * dimensions and values of the operation for which that operand
1538 * is an output.
1539 *
1540 * In the following situations, a tensor operand's dimensions must
1541 * be fully specified:
1542 *
1543 * . The operand has lifetime CONSTANT_COPY or
1544 * CONSTANT_REFERENCE.
1545 *
1546 * . The operand has lifetime MODEL_INPUT or MODEL_OUTPUT. Fully
1547 * specified dimensions must either be present in the
1548 * Operand or they must be provided in the corresponding
1549 * RequestArgument.
1550 * EXCEPTION: If the input or output is optional and omitted
1551 * (by setting the hasNoValue field of the corresponding
1552 * RequestArgument to true) then it need not have fully
1553 * specified dimensions.
1554 *
1555 * A tensor operand with some number of unspecified dimensions is
1556 * represented by setting each unspecified dimension to 0.
1522 */ 1557 */
1523 vec<uint32_t> dimensions; 1558 vec<uint32_t> dimensions;
1524 1559
@@ -1662,10 +1697,19 @@ struct RequestArgument {
1662 /** 1697 /**
1663 * Updated dimension information. 1698 * Updated dimension information.
1664 * 1699 *
1665 * If dimensions.size() > 0, dimension information was provided along with 1700 * If dimensions.size() > 0, dimension information was provided
1666 * the argument. This can be the case for models that accept inputs of 1701 * along with the argument. This can be the case for models that
1667 * varying size. This can't change the rank, just the value of the 1702 * accept inputs of varying size. This can't change the rank, just
1668 * dimensions that were unspecified in the model. 1703 * the value of the dimensions that were unspecified in the
1704 * model. If dimensions.size() > 0, then all dimensions must be
1705 * specified here; and any dimension that was specified in the
1706 * model must have the same value here.
1707 *
1708 * If the dimensions in the model are not fully specified, then
1709 * they must be fully specified here, unless hasNoValue is set to
1710 * true. If the dimensions in the model are fully specified, then
1711 * either dimensions.size() may be 0, or the dimensions in the
1712 * model must be identical to the dimensions here.
1669 */ 1713 */
1670 vec<uint32_t> dimensions; 1714 vec<uint32_t> dimensions;
1671}; 1715};