diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2020-07-10 15:55:15 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2020-07-10 15:55:15 +0000 |
commit | e3a65e1b5da3b00ecfd1cf0f53bebe5b41038d55 (patch) | |
tree | 498d78ead21e08a8c4e8dd6b5c31a493e4856b36 | |
parent | 66aedf22e0997344d54271d73066f49c07280127 (diff) | |
parent | 00437ff8f10d0b8c271c05545309a84b17ed14e3 (diff) | |
download | ml-e3a65e1b5da3b00ecfd1cf0f53bebe5b41038d55.tar.gz |
Merge "Update scale and zeroPoint documentation"
-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 9dc7bc04b..21633e76f 100644 --- a/nn/runtime/include/NeuralNetworks.h +++ b/nn/runtime/include/NeuralNetworks.h @@ -6231,11 +6231,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 1f5729034..310acf625 100644 --- a/nn/tools/api/NeuralNetworks.t +++ b/nn/tools/api/NeuralNetworks.t @@ -657,11 +657,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; |