diff options
author | Slava Shklyaev <slavash@google.com> | 2020-07-02 16:19:03 +0100 |
---|---|---|
committer | Slava Shklyaev <slavash@google.com> | 2020-07-02 16:40:51 +0100 |
commit | c637d993570cbc22e8c72894c02f8172243a2afe (patch) | |
tree | e670787d3ce5016bef9198ab79a97a25a0620403 /nn | |
parent | 14f169438ee72bef00f8751bf1ec8aa96af8dff7 (diff) | |
download | ml-c637d993570cbc22e8c72894c02f8172243a2afe.tar.gz |
Update scale and zeroPoint documentationandroid11-dev
The description for zeroPoint appears to be empty on
https://developer.android.com/ndk/reference/struct/a-neural-networks-operand-type.html#zeropoint
Moreover, the description for the two fields has become outdated, e.g.
- TENSOR_QUANT16_SYMM only uses scale,
- TENSOR_QUANT8_SYMM_PER_CHANNEL does not use scale or zeroPoint.
Fix: 146789186
Bug: 160406237
Test: generate_api.sh
Test: m
Change-Id: I439a70405a47576da22dacf7070de3bf65ac7caf
Diffstat (limited to 'nn')
-rw-r--r-- | nn/runtime/include/NeuralNetworks.h | 16 | ||||
-rw-r--r-- | nn/tools/api/NeuralNetworks.t | 16 |
2 files changed, 26 insertions, 6 deletions
diff --git a/nn/runtime/include/NeuralNetworks.h b/nn/runtime/include/NeuralNetworks.h index 2f7d3b38e..1eb2f5466 100644 --- a/nn/runtime/include/NeuralNetworks.h +++ b/nn/runtime/include/NeuralNetworks.h @@ -6230,11 +6230,21 @@ typedef struct ANeuralNetworksOperandType { const uint32_t* dimensions; /** - * These two fields are only used for quantized tensors. - * They must be zero for all other types. - * The dequantized value of each entry is (value - zeroPoint) * scale. + * The quantization scale. + * + * Must be 0 when not applicable to an operand type. + * + * See {@link OperandCode}. */ float scale; + + /** + * The quantization zero point. + * + * Must be 0 when not applicable to an operand type. + * + * See {@link OperandCode}. + */ int32_t zeroPoint; } ANeuralNetworksOperandType; diff --git a/nn/tools/api/NeuralNetworks.t b/nn/tools/api/NeuralNetworks.t index a6ab569cd..d7cf8b2d0 100644 --- a/nn/tools/api/NeuralNetworks.t +++ b/nn/tools/api/NeuralNetworks.t @@ -656,11 +656,21 @@ typedef struct ANeuralNetworksOperandType { const uint32_t* dimensions; /** - * These two fields are only used for quantized tensors. - * They must be zero for all other types. - * The dequantized value of each entry is (value - zeroPoint) * scale. + * The quantization scale. + * + * Must be 0 when not applicable to an operand type. + * + * See {@link OperandCode}. */ float scale; + + /** + * The quantization zero point. + * + * Must be 0 when not applicable to an operand type. + * + * See {@link OperandCode}. + */ int32_t zeroPoint; } ANeuralNetworksOperandType; |