aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominic Symes <dominic.symes@arm.com>2020-10-30 17:34:19 +0000
committerDominic Symes <dominic.symes@arm.com>2020-11-06 18:33:45 +0000
commit23418f7246acee8f1fd475c118e663c8dc9fc7db (patch)
tree7ea33c0061ce94a3586854f376432f57e57dc60b
parent646ef42f0357c85b2898c39d1657a85487ac751c (diff)
downloadspecification-23418f7246acee8f1fd475c118e663c8dc9fc7db.tar.gz
GATHER: Add operation code
Add the operation code for GATHER and reduce number of arguments. Signed-off-by: Dominic Symes <dominic.symes@arm.com> Change-Id: I51b6ede43dcae1e1aec7a11a75a1e4bf6c668673
-rw-r--r--chapters/scatter_gather.adoc31
1 files changed, 22 insertions, 9 deletions
diff --git a/chapters/scatter_gather.adoc b/chapters/scatter_gather.adoc
index 29ba391..cfee60b 100644
--- a/chapters/scatter_gather.adoc
+++ b/chapters/scatter_gather.adoc
@@ -11,30 +11,43 @@
==== GATHER
-Generate a tensor for which each element in the output is a subtensor of the values tensor along the given axis, based on the value of indices.
+Generate a tensor for which each element in the output is a subtensor of the values tensor based on the indices.
+N is the number of batches, W the number of indices in each batch, K the range of each index and C the number data channels for each index.
*Arguments:*
|===
|Argument|Type|Name|Shape|Description
-|Input|index_t*|indices|shape|Input tensor from 1 to 4 dims
-|Input|value_t*|values|shape|Input tensor from 1 to 4 dims. Must be of rank at least axis + 1
-|Attribute|int|axis|-|Scalar value denoting which dimension to be used for striding.
-|Output|out_t*|output|shape|Output tensor
+|Input|value_t*|values|[N,K,C]|3D value tensor
+|Input|index_t*|indices|[N,W]|2D index tensor
+|Output|value_t*|output|[N,W,C]|3D output tensor
|===
*Quantization Parameters:*
None
+*Operation Function:*
+
+[source,c]
+----
+for_each(0<=n<N, 0<=w<W, 0<=c<C) {
+ index_t k = tensor_read<index_t>(indices, [N,W], [n,w])
+ assert(0<=k && k<K)
+ value_t value = tensor_read<value_t>(values, [N,K,C], [n, k, c])
+ tensor_write<value_t>(output, [N,W,C], [n,w,c])
+}
+----
+
*Supported Data Types:*
|===
-|Profile|Mode|index_t|value_t|out_t
+|Profile|Mode|index_t|value_t
-|Any|signed 8|int8/int16|aint8|aint8
-|Any|signed 16|int8/int16|int16|int16
-|Any|signed 32|int8/int16|int32|int32
+|Any|signed 8|int32|aint8
+|Any|signed 16|int32|int16
+|Any|signed 32|int32|int32
+|MI,MT|float|int32|float
|===