aboutsummaryrefslogtreecommitdiff
path: root/chapters/comparison.adoc
diff options
context:
space:
mode:
Diffstat (limited to 'chapters/comparison.adoc')
-rw-r--r--chapters/comparison.adoc26
1 files changed, 13 insertions, 13 deletions
diff --git a/chapters/comparison.adoc b/chapters/comparison.adoc
index 43f0787..ad574fb 100644
--- a/chapters/comparison.adoc
+++ b/chapters/comparison.adoc
@@ -1,7 +1,7 @@
//
// This confidential and proprietary software may be used only as
// authorised by a licensing agreement from ARM Limited
-// (C) COPYRIGHT 2020 ARM Limited
+// (C) COPYRIGHT 2020-2021 ARM Limited
// ALL RIGHTS RESERVED
// The entire notice above must be reproduced on all authorised
// copies and copies may only be made to the extent permitted
@@ -30,10 +30,10 @@ Elementwise comparison operation
for_each(index in shape) {
index1 = apply_broadcast(shape, shape1, index);
index2 = apply_broadcast(shape, shape2, index);
- int32_t value1 = tensor_read<in_t>(input1, shape1, index1);
- int32_t value2 = tensor_read<in_t>(input2, shape2, index2);
- bool_t acc = (value1 == value2) ? True : False;
- tensor_write<out_t>(output, shape, index, acc);
+ in_t value1 = tensor_read<in_t>(input1, shape1, index1);
+ in_t value2 = tensor_read<in_t>(input2, shape2, index2);
+ out_t result = (value1 == value2) ? True : False;
+ tensor_write<out_t>(output, shape, index, result);
}
----
@@ -67,10 +67,10 @@ Elementwise greater than comparison operation
for_each(index in shape) {
index1 = apply_broadcast(shape, shape1, index);
index2 = apply_broadcast(shape, shape2, index);
- int32_t value1 = tensor_read<in_t>(input1, shape1, index1);
- int32_t value2 = tensor_read<in_t>(input2, shape2, index2);
- bool_t acc = (value1 > value2) ? True : False;
- tensor_write<out_t>(output, shape, index, acc);
+ in_t value1 = tensor_read<in_t>(input1, shape1, index1);
+ in_t value2 = tensor_read<in_t>(input2, shape2, index2);
+ out_t result = (value1 > value2) ? True : False;
+ tensor_write<out_t>(output, shape, index, result);
}
----
@@ -103,10 +103,10 @@ Elementwise comparison operation
for_each(index in shape) {
index1 = apply_broadcast(shape, shape1, index);
index2 = apply_broadcast(shape, shape2, index);
- int32_t value1 = tensor_read<in_t>(input1, shape1, index1);
- int32_t value2 = tensor_read<in_t>(input2, shape2, index2);
- bool_t acc = (value1 >= value2) ? True : False;
- tensor_write<out_t>(output, shape, index, acc);
+ in_t value1 = tensor_read<in_t>(input1, shape1, index1);
+ in_t value2 = tensor_read<in_t>(input2, shape2, index2);
+ out_t result = (value1 >= value2) ? True : False;
+ tensor_write<out_t>(output, shape, index, result);
}
----