aboutsummaryrefslogtreecommitdiff
path: root/chapters/reduction.adoc
diff options
context:
space:
mode:
authorDominic Symes <dominic.symes@arm.com>2021-03-19 13:56:27 +0000
committerDominic Symes <dominic.symes@arm.com>2021-07-13 09:51:07 +0100
commitca2a854e3d46f91ecaa446d4b2311112cc2326fd (patch)
tree23fc1bb30c333a28d4a743a4a05059b79cf7b826 /chapters/reduction.adoc
parenta9101530d8ea7a3cb470b722bc6cf8745ab283ac (diff)
downloadspecification-ca2a854e3d46f91ecaa446d4b2311112cc2326fd.tar.gz
Add definition of TOSA compliance
Signed-off-by: Dominic Symes <dominic.symes@arm.com> Change-Id: I2e25d0467843adb078d5ab9fd681af40b2ffa52e
Diffstat (limited to 'chapters/reduction.adoc')
-rw-r--r--chapters/reduction.adoc24
1 files changed, 12 insertions, 12 deletions
diff --git a/chapters/reduction.adoc b/chapters/reduction.adoc
index 391591f..c39fecf 100644
--- a/chapters/reduction.adoc
+++ b/chapters/reduction.adoc
@@ -27,8 +27,8 @@ Reduce a tensor along the given axis with a logical AND operation
[source,c]
----
-REQUIRE(0 <= axis && axis < rank(shape1));
-REQUIRE(shape[axis] == 1);
+ERROR_IF(axis < 0 || axis >= rank(shape1));
+ERROR_IF(shape[axis] != 1);
for_each(index in shape) {
tensor_write<in_t>(output, shape, index, true);
}
@@ -68,8 +68,8 @@ Reduce a tensor along the given axis with a logical OR operation
[source,c]
----
-REQUIRE(0 <= axis && axis < rank(shape1));
-REQUIRE(shape[axis] == 1);
+ERROR_IF(axis < 0 || axis >= rank(shape1));
+ERROR_IF(shape[axis] != 1);
for_each(index in shape) {
tensor_write<in_t>(output, shape, index, false);
}
@@ -109,8 +109,8 @@ Reduce a tensor along the given axis with a maximum operation
[source,c]
----
-REQUIRE(0 <= axis && axis < rank(shape1));
-REQUIRE(shape[axis] == 1);
+ERROR_IF(axis < 0 || axis >= rank(shape1));
+ERROR_IF(shape[axis] != 1);
for_each(index in shape) {
tensor_write<in_t>(output, shape, index, minimum<in_t>);
}
@@ -156,8 +156,8 @@ Quantization is ignored when doing the REDUCE_MIN operation. The input and outpu
[source,c]
----
-REQUIRE(0 <= axis && axis < rank(shape1));
-REQUIRE(shape[axis]==1);
+ERROR_IF(axis < 0 || axis >= rank(shape1));
+ERROR_IF(shape[axis] != 1);
for_each(index in shape) {
tensor_write<in_t>(output, shape, index, maximum<in_t>);
}
@@ -200,8 +200,8 @@ Reduce a tensor along the given axis by computing the product of the axis.
[source,c]
----
-REQUIRE(0 <= axis && axis < rank(shape1));
-REQUIRE(shape[axis] == 1);
+ERROR_IF(axis < 0 || axis >= rank(shape1));
+ERROR_IF(shape[axis] != 1);
for_each(index in shape) {
tensor_write<in_t>(output, shape, index, 1.0);
}
@@ -241,8 +241,8 @@ Reduce a tensor along the given axis by computing the sum of the axis.
[source,c]
----
-REQUIRE(0 <= axis && axis < rank(shape1));
-REQUIRE(shape[axis] == 1);
+ERROR_IF(axis < 0 || axis >= rank(shape1));
+ERROR_IF(shape[axis] != 1);
for_each(index in shape) {
tensor_write<in_t>(output, shape, index, 0);
}