diff options
author | Eric Kunze <eric.kunze@arm.com> | 2021-10-25 16:04:20 -0700 |
---|---|---|
committer | Eric Kunze <eric.kunze@arm.com> | 2021-10-28 09:57:46 -0700 |
commit | 3170439f3938d007e58998d61eed98560c3f026c (patch) | |
tree | 6f4abac7c7c037b749c6801e95259fdd14cfd341 /chapters/introduction.adoc | |
parent | 82019a2621edf481e12b5de09dbfe5dc56283150 (diff) | |
download | specification-3170439f3938d007e58998d61eed98560c3f026c.tar.gz |
Remove zp subtraction from tensor_read pseudocode
Operators which use the zero-point functionalty for 8-bit integer
processing are updated to do the zero-point subtract in their
pseudocode.
Note that the PAD operator no longer takes a zero point argument,
and instead requires callers to account for the zero point in the
pad_const argument.
Change-Id: I3bca1cae85aa2093000c420f0433633c347a29de
Diffstat (limited to 'chapters/introduction.adoc')
-rw-r--r-- | chapters/introduction.adoc | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/chapters/introduction.adoc b/chapters/introduction.adoc index 93276f1..855be3d 100644 --- a/chapters/introduction.adoc +++ b/chapters/introduction.adoc @@ -253,14 +253,10 @@ The following pseudocode represents the operations that will happen to data elem tensor_read reads a single data value out of the given tensor. The shape argument contains the shape of the tensor. Index is the coordinates within the tensor of the value to be read. -zero_point is the zero point value to be added for int8 values. -If in_t is 8-bit then out_t=int16_t to account for the zero_point subtraction. -Otherwise out_t is the same as in_t. [source,c++] ---- -out_t tensor_read<in_t>(in_t *address, dim_t shape, dim_t index, in_t zero_point=0) { - ERROR_IF(in_t != int8_t && zero_point != 0); +in_t tensor_read<in_t>(in_t *address, dim_t shape, dim_t index) { // Ensure this is a proper tensor with each dimension having size >= 1 for_each(dimension_size in shape) { REQUIRE(dimension_size >= 1); @@ -270,7 +266,7 @@ out_t tensor_read<in_t>(in_t *address, dim_t shape, dim_t index, in_t zero_point REQUIRE(index[i] >= 0 && index[i] < shape[i]); offset = offset * shape[i] + index[i]; } - return address[offset] - zero_point; + return address[offset]; } ---- |