aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Kunze <eric.kunze@arm.com>2022-01-07 14:34:01 -0800
committerEric Kunze <eric.kunze@arm.com>2022-01-10 09:40:51 -0800
commitc1e39d5b5ce31234f1d03aebfb960859f234f12b (patch)
tree19db29d0b81732540eadc7a261dbb67bb955670c
parente942f07388abbdb3b66974a4f41cf9d21e56a4dc (diff)
downloadspecification-c1e39d5b5ce31234f1d03aebfb960859f234f12b.tar.gz
Simplify shape checking for TRANSPOSE
Have a simple outer check for proper size rather than checking during the inner loop. Change-Id: I20312c5f6b4aacbb630a2df0f901d8586caa04c0 Signed-off-by: Eric Kunze <eric.kunze@arm.com>
-rw-r--r--chapters/data_layout.adoc10
1 files changed, 8 insertions, 2 deletions
diff --git a/chapters/data_layout.adoc b/chapters/data_layout.adoc
index e50a14e..395843a 100644
--- a/chapters/data_layout.adoc
+++ b/chapters/data_layout.adoc
@@ -309,11 +309,17 @@ for_each(index in perms) {
ERROR_IF(indexes_used[index] == true);
indexes_used[index] = true;
}
+
+// Ensure that the output shapes have the properly
+// permuted shapes
+for(i = 0; i < rank(shape); i++) {
+ ERROR_IF(shape1[perms[i]] != shape[i])
+}
+
for_each(index in shape) {
tmp_index = index;
for(i = 0; i < rank(shape); i++) {
- REQUIRE(shape1[perm[i]] == shape[i])
- tmp_index[perm[i]] = index[i]
+ tmp_index[perms[i]] = index[i]
}
in_out_t value = tensor_read<in_out_t>(input, shape1, tmp_index);
tensor_write<in_out_t>(output, shape, index, value);