aboutsummaryrefslogtreecommitdiff
path: root/chapters/data_layout.adoc
diff options
context:
space:
mode:
authorEric Kunze <eric.kunze@arm.com>2021-10-25 16:04:20 -0700
committerEric Kunze <eric.kunze@arm.com>2021-10-28 09:57:46 -0700
commit3170439f3938d007e58998d61eed98560c3f026c (patch)
tree6f4abac7c7c037b749c6801e95259fdd14cfd341 /chapters/data_layout.adoc
parent82019a2621edf481e12b5de09dbfe5dc56283150 (diff)
downloadspecification-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/data_layout.adoc')
-rw-r--r--chapters/data_layout.adoc19
1 files changed, 9 insertions, 10 deletions
diff --git a/chapters/data_layout.adoc b/chapters/data_layout.adoc
index 205ccaf..54221f6 100644
--- a/chapters/data_layout.adoc
+++ b/chapters/data_layout.adoc
@@ -68,6 +68,7 @@ for_each(index1 in shape) {
Pads a tensor along the borders of each dimension with a supplied value.
Returns a new tensor with the padding included.
+The pad_const value includes the zero point if the tensor uses a zero point.
*Arguments:*
@@ -77,7 +78,6 @@ Returns a new tensor with the padding included.
|Input|in_t*|input1|shape1|Input tensor
|Attribute|int|padding|[rank(input1),2]|Amount of padding to be done
|Attribute|in_t|pad_const|-|Constant value to be used as padding
-|Attribute|in_t|input1_zp|-|Input tensor zero point. Must be zero for non-int8 types.
|Output|in_t*|output|shape|Output tensor of same type as the input tensor
|===
@@ -85,7 +85,6 @@ Returns a new tensor with the padding included.
[source,c++]
----
-ERROR_IF(in_t != int8_t && input1_zp != 0); // Zero point only allowed for int8_t
// Padding sizes must be >= 0.
for_each(pad_size in padding) {
ERROR_IF(pad_size < 0);
@@ -99,21 +98,21 @@ for_each(index in shape) {
is_pad = true;
}
}
- acc_t value = is_pad ? pad_const : tensor_read<in_t>(input1, shape1, index1, input1_zp);
- tensor_write<in_t>(output, shape, index, value + input1_zp);
+ in_t value = is_pad ? pad_const : tensor_read<in_t>(input1, shape1, index1);
+ tensor_write<in_t>(output, shape, index, value);
}
----
*Supported Data Types:*
|===
-|Profile|Mode|in_t|acc_t
+|Profile|Mode|in_t
-|Any|Boolean|bool_t|bool_t
-|Any|signed 8|int8_t|int16_t
-|Any|signed 16|int16_t|int16_t
-|Any|signed 32|int32_t|int32_t
-|MI, MT|floating-point|float_t|float_t
+|Any|Boolean|bool_t
+|Any|signed 8|int8_t
+|Any|signed 16|int16_t
+|Any|signed 32|int32_t
+|MI, MT|floating-point|float_t
|===
==== RESHAPE