aboutsummaryrefslogtreecommitdiff
path: root/chapters/reduction.adoc
diff options
context:
space:
mode:
authorEric Kunze <eric.kunze@arm.com>2020-10-08 14:33:53 -0700
committerEric Kunze <eric.kunze@arm.com>2020-10-08 14:37:12 -0700
commitedbb7ba7504c13ea3fad8ee4e822bf451c8b8240 (patch)
tree777c31e6f1fa0c88fb618f06dd409c137dabf004 /chapters/reduction.adoc
parent3309a5362a13f840e84a2f67b9ba7141aae58cc4 (diff)
downloadspecification-edbb7ba7504c13ea3fad8ee4e822bf451c8b8240.tar.gz
Fix ordering of operators
REDUCE_ANY/ALL PLACEHOLDER/IDENTITY* Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I3436a91b8137fa4fce9b8c2027cd669cfbdcd539
Diffstat (limited to 'chapters/reduction.adoc')
-rw-r--r--chapters/reduction.adoc16
1 files changed, 8 insertions, 8 deletions
diff --git a/chapters/reduction.adoc b/chapters/reduction.adoc
index bef68a3..a9687b1 100644
--- a/chapters/reduction.adoc
+++ b/chapters/reduction.adoc
@@ -9,9 +9,9 @@
=== Reduction Operators
-==== REDUCE_ANY
+==== REDUCE_ALL
-Reduce a tensor along the given axes with a logical OR operation
+Reduce a tensor along the given axes with a logical AND operation
*Arguments:*
@@ -34,7 +34,7 @@ for_each (axis in axes[]) {
}
if (keep_dims) assert(tmp_shape == out_shape)
for_each (index in tmp_shape) {
- tensor_write<in_t>(output, tmp_shape, index, false)
+ tensor_write<in_t>(output, tmp_shape, index, true)
}
for_each (index in in_shape) {
tmp_index = index;
@@ -43,7 +43,7 @@ for_each (index in in_shape) {
}
value = tensor_read<in_t>(input, in_shape, index)
acc = tensor_read<in_t>(output, tmp_shape, tmp_index)
- acc = acc || value
+ acc = acc && value
tensor_write<in_t>(output, tmp_shape, tmp_index, acc)
}
----
@@ -56,9 +56,9 @@ for_each (index in in_shape) {
|Any|Boolean|bool|bool
|===
-==== REDUCE_ALL
+==== REDUCE_ANY
-Reduce a tensor along the given axes with a logical AND operation
+Reduce a tensor along the given axes with a logical OR operation
*Arguments:*
@@ -81,7 +81,7 @@ for_each (axis in axes[]) {
}
if (keep_dims) assert(tmp_shape == out_shape)
for_each (index in tmp_shape) {
- tensor_write<in_t>(output, tmp_shape, index, true)
+ tensor_write<in_t>(output, tmp_shape, index, false)
}
for_each (index in in_shape) {
tmp_index = index;
@@ -90,7 +90,7 @@ for_each (index in in_shape) {
}
value = tensor_read<in_t>(input, in_shape, index)
acc = tensor_read<in_t>(output, tmp_shape, tmp_index)
- acc = acc && value
+ acc = acc || value
tensor_write<in_t>(output, tmp_shape, tmp_index, acc)
}
----