From 8783adb282f4d6414a1442042bd8e02afcd12b18 Mon Sep 17 00:00:00 2001 From: Dominic Symes Date: Wed, 27 Jul 2022 12:53:11 +0100 Subject: RESCALE and POW: remove rank restriction Also be consistent to use the term 'rank' rather than 'dims'. Change-Id: Ica827fcfd44e9735da2d1a4ddb8cb1fa04c6479b Signed-off-by: Dominic Symes --- chapters/type_conversion.adoc | 2 +- tosa.xml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/chapters/type_conversion.adoc b/chapters/type_conversion.adoc index 90452a3..c3d986e 100644 --- a/chapters/type_conversion.adoc +++ b/chapters/type_conversion.adoc @@ -65,7 +65,7 @@ for_each(index in shape) { ERROR_IF(!scale32 && double_round); int48_t value = tensor_read(input, shape, index); value = value - input_zp; - int c = (per_channel) ? index[dims-1] : 0; + int c = (per_channel) ? index[rank(input) - 1] : 0; int32_t result = (scale32) ? apply_scale_32(value, multiplier[c], shift[c], double_round) : apply_scale_16(value, multiplier[c], shift[c]); diff --git a/tosa.xml b/tosa.xml index 6674ef0..bc86354 100644 --- a/tosa.xml +++ b/tosa.xml @@ -901,7 +901,7 @@ POW - Input tensor from 1 to 4 dims + Input tensor Input tensor with the same rank as input1 @@ -1650,7 +1650,7 @@ REVERSE - Input tensor from 1 to 4 dims + Input tensor with rank from 1 to 4 Axis to reverse, in range from 0 to rank(shape)-1 @@ -2004,7 +2004,7 @@ used. RESCALE - Input tensor from 1 to 4 dims + Input tensor Output tensor with the same shape as input @@ -2028,7 +2028,7 @@ used. Select double round mode - if (per_channel) NC=shape[dims-1] else NC=1 + if (per_channel) NC=shape[rank(shape)-1] else NC=1 -- cgit v1.2.1