From 298a029348e07903b1f78eb9994230fa205e869e Mon Sep 17 00:00:00 2001
From: Dominic Symes <dominic.symes@arm.com>
Date: Thu, 22 Oct 2020 15:36:24 +0100
Subject: 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
---
 chapters/data_layout.adoc | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

(limited to 'chapters/data_layout.adoc')

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]
     }
-- 
cgit v1.2.1

