aboutsummaryrefslogtreecommitdiff
path: root/chapters/data_layout.adoc
diff options
context:
space:
mode:
authorDominic Symes <dominic.symes@arm.com>2020-10-22 15:36:24 +0100
committerDominic Symes <dominic.symes@arm.com>2020-10-22 15:39:46 +0100
commit298a029348e07903b1f78eb9994230fa205e869e (patch)
treeaeb3f2c39949992c172f56f3f30140a716990314 /chapters/data_layout.adoc
parent1d84a1e8269b3f61aaa12219221e3bbf68a61fc6 (diff)
downloadspecification-298a029348e07903b1f78eb9994230fa205e869e.tar.gz
Make rank() consistent across files
Complete the function naming change from dimensions() to rank(). Fix MATMUL to use apply_add() for additions, consistent with the other operations. Signed-off-by: Dominic Symes <dominic.symes@arm.com> Change-Id: I6ba84cf8b016505e8477b04dd00f2a2bf3194492
Diffstat (limited to 'chapters/data_layout.adoc')
-rw-r--r--chapters/data_layout.adoc10
1 files changed, 5 insertions, 5 deletions
diff --git a/chapters/data_layout.adoc b/chapters/data_layout.adoc
index 3a7c3c3..bec551b 100644
--- a/chapters/data_layout.adoc
+++ b/chapters/data_layout.adoc
@@ -77,7 +77,7 @@ Zero-pads a tensor along borders of each dimension.
----
for_each (index in shape) {
index1 = index
- for (i=0; i<dimensions(shape); i++) {
+ for (i=0; i<rank(shape); i++) {
index1[i] = index1[i] - padding[i,0]
}
value = tensor_read<in_t>(input1, shape1, index1, input1_zp, padding)
@@ -151,7 +151,7 @@ Returns a tensor with the same type/values as the input, with the data reversed
[source,c]
----
-assert(0<=axis && axis<dimensions(shape))
+assert(0<=axis && axis<rank(shape))
for_each (index in shape) {
tmp_index = index;
tmp_index[axis] = shape[axis]-1-index[axis];
@@ -192,7 +192,7 @@ Extracts a slice of the input tensor 0 on the given axis, beginning at the start
----
for_each (index in shape) {
tmp_index = index;
- for (i=0; i<dimensions(shape); i++) {
+ for (i=0; i<rank(shape); i++) {
tmp_index[i] = index[i] + start[i];
}
value = tensor_read<in_t>(input, shape1, tmp_index);
@@ -232,7 +232,7 @@ Replicates input 0 multiplies times along each dimension.
----
for_each (index in shape) {
tmp_index = index;
- for (i=0; i<dimensions(shape); i++) {
+ for (i=0; i<rank(shape); i++) {
assert(shape1[i] * multiplies[i] == shape[i])
tmp_index[i] = index[i] % shape1[i]
}
@@ -273,7 +273,7 @@ Permutes the dimensions based on perm.
----
for_each (index in shape) {
tmp_index = index;
- for (i=0; i<dimensions(shape); i++) {
+ for (i=0; i<rank(shape); i++) {
assert(shape1[perm[i]] == shape[i])
tmp_index[perm[i]] = index[i]
}