aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominic Symes <dominic.symes@arm.com>2022-07-27 12:53:11 +0100
committerDominic Symes <dominic.symes@arm.com>2022-08-26 09:11:01 +0100
commit8783adb282f4d6414a1442042bd8e02afcd12b18 (patch)
tree82aad31c55fce13032f675e4acb2c4329861184d
parenteda7b126d3914e9461cf014439b3571b9e6a9c41 (diff)
downloadspecification-8783adb282f4d6414a1442042bd8e02afcd12b18.tar.gz
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 <dominic.symes@arm.com>
-rw-r--r--chapters/type_conversion.adoc2
-rw-r--r--tosa.xml8
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<in_t>(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 @@
<name>POW</name>
<arguments>
<argument category="input" name="input1" type="in_out_t*" shape="shape1">
- <description>Input tensor from 1 to 4 dims</description>
+ <description>Input tensor</description>
</argument>
<argument category="input" name="input2" type="in_out_t*" shape="shape2">
<description>Input tensor with the same rank as input1</description>
@@ -1650,7 +1650,7 @@
<name>REVERSE</name>
<arguments>
<argument category="input" name="input" type="in_out_t*" shape="shape">
- <description>Input tensor from 1 to 4 dims</description>
+ <description>Input tensor with rank from 1 to 4</description>
</argument>
<argument category="attribute" name="axis" type="int32_t" shape="-">
<description>Axis to reverse, in range from 0 to rank(shape)-1</description>
@@ -2004,7 +2004,7 @@ used.</description>
<name>RESCALE</name>
<arguments>
<argument category="input" name="input" type="in_t" shape="shape">
- <description>Input tensor from 1 to 4 dims</description>
+ <description>Input tensor</description>
</argument>
<argument category="output" name="output" type="out_t" shape="shape">
<description>Output tensor with the same shape as input</description>
@@ -2028,7 +2028,7 @@ used.</description>
<description>Select double round mode</description>
</argument>
<argument category="attribute" name="per_channel" type="bool_t" shape="-">
- <description>if (per_channel) NC=shape[dims-1] else NC=1</description>
+ <description>if (per_channel) NC=shape[rank(shape)-1] else NC=1</description>
</argument>
</arguments>
<types>