diff options
author | Dominic Symes <dominic.symes@arm.com> | 2023-03-06 17:14:15 +0000 |
---|---|---|
committer | Dominic Symes <dominic.symes@arm.com> | 2023-03-20 10:39:56 +0000 |
commit | 67a6f7f26f092860a4e1b3f6ac0c2e5cde9bf685 (patch) | |
tree | 2be362915e3897118303ef34531db6b2b0200142 /chapters/comparison.adoc | |
parent | 18548921437ef60e5553a75517449918e5c42b1d (diff) | |
download | specification-67a6f7f26f092860a4e1b3f6ac0c2e5cde9bf685.tar.gz |
Check the output shape of broadcast operations
For an operation that performs broadcast the
output shape size must be the maximum of the input shape
sizes in each dimension.
Additionally, the input dimension size must be 1 whenever
an input shape does not match the output shape size
in a dimension.
Signed-off-by: Dominic Symes <dominic.symes@arm.com>
Change-Id: I89492f4ef22da76f84f12e720c79634ea42545bc
Diffstat (limited to 'chapters/comparison.adoc')
-rw-r--r-- | chapters/comparison.adoc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/chapters/comparison.adoc b/chapters/comparison.adoc index f4da361..4ef52d6 100644 --- a/chapters/comparison.adoc +++ b/chapters/comparison.adoc @@ -17,6 +17,7 @@ include::{generated}/operators/EQUAL.adoc[] [source,c++] ---- +ERROR_IF(shape != broadcast_shape(shape1, shape2)); for_each(index in shape) { dim_t index1 = apply_broadcast(shape, shape1, index); dim_t index2 = apply_broadcast(shape, shape2, index); @@ -39,6 +40,7 @@ include::{generated}/operators/GREATER.adoc[] [source,c++] ---- +ERROR_IF(shape != broadcast_shape(shape1, shape2)); for_each(index in shape) { dim_t index1 = apply_broadcast(shape, shape1, index); dim_t index2 = apply_broadcast(shape, shape2, index); @@ -61,6 +63,7 @@ include::{generated}/operators/GREATER_EQUAL.adoc[] [source,c++] ---- +ERROR_IF(shape != broadcast_shape(shape1, shape2)); for_each(index in shape) { dim_t index1 = apply_broadcast(shape, shape1, index); dim_t index2 = apply_broadcast(shape, shape2, index); |