aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Kunze <eric.kunze@arm.com>2021-10-25 16:06:55 -0700
committerEric Kunze <eric.kunze@arm.com>2021-10-28 09:57:55 -0700
commit3fe5256340778f586b80ac02b0632b54a39723f1 (patch)
treef311ae85980464333dacb20d1fedd86497f0fb2f
parent3170439f3938d007e58998d61eed98560c3f026c (diff)
downloadspecification-3fe5256340778f586b80ac02b0632b54a39723f1.tar.gz
Clarify CLAMP pseudocode
CLAMP does not do any zero point modification of its clamp limits. Callers to CLAMP should provide values with the zero-point accounted for in the arguments. Change-Id: I27ee468ecd5ab53e33dcbac9c91b705b39e49f96
-rw-r--r--chapters/activation_funcs.adoc18
1 files changed, 10 insertions, 8 deletions
diff --git a/chapters/activation_funcs.adoc b/chapters/activation_funcs.adoc
index 59030d8..a58a1fc 100644
--- a/chapters/activation_funcs.adoc
+++ b/chapters/activation_funcs.adoc
@@ -11,7 +11,9 @@
=== Activation Functions
==== CLAMP
-Clamp to an arbitrary minimum and maximum value. Note that the maximum and minimum values are specified as signed quantized values, no scaling happens before or after this operation.
+Clamp to an arbitrary minimum and maximum value.
+Maximum and minimum values are specified as values in the range of the input type.
+No zero point subtraction is done to the values, thus to clamp to the zero point value, the zero point itself should be supplied as the minimum value.
*Arguments:*
@@ -29,20 +31,20 @@ Clamp to an arbitrary minimum and maximum value. Note that the maximum and minim
----
ERROR_IF(max_val < min_val);
for_each(index in shape) {
- acc_t value = tensor_read<in_t>(input, shape, index);
- acc = (in_t)apply_clip<acc_t>(value, min_val, max_val);
- tensor_write<in_t>(output, shape, index, acc);
+ in_t value = tensor_read<in_t>(input, shape, index);
+ value = apply_clip<in_t>(value, min_val, max_val);
+ tensor_write<in_t>(output, shape, index, value);
}
----
*Supported Data Types:*
|===
-|Profile|Mode|in_t|acc_t
+|Profile|Mode|in_t
-|Any|signed 8|int8_t|int16_t
-|Any|signed 16|int16_t|int16_t
-|MI, MT|floating-point|float_t|float_t
+|Any|signed 8|int8_t
+|Any|signed 16|int16_t
+|MI, MT|floating-point|float_t
|===
==== SIGMOID