From 4ee64650102977d2a6962b4ee5924e418da024cf Mon Sep 17 00:00:00 2001 From: Dominic Symes Date: Tue, 10 Nov 2020 11:50:19 +0000 Subject: SCATTER: Add operation Add the scatter operation to the gather/scatter section. Signed-off-by: Dominic Symes Change-Id: I9baaef91bf70eae3b13e6e585df6c4821a0c1a93 --- chapters/scatter_gather.adoc | 51 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/chapters/scatter_gather.adoc b/chapters/scatter_gather.adoc index cfee60b..e1be77f 100644 --- a/chapters/scatter_gather.adoc +++ b/chapters/scatter_gather.adoc @@ -36,7 +36,7 @@ for_each(0<=n(indices, [N,W], [n,w]) assert(0<=k && k(values, [N,K,C], [n, k, c]) - tensor_write(output, [N,W,C], [n,w,c]) + tensor_write(output, [N,W,C], [n,w,c], value) } ---- @@ -51,3 +51,52 @@ for_each(0<=n(values_in, [N,K,C], [n,k,c]) + tensor_write(values_out, [N,K,C], [n, k, c], value) +} +// Now perform the SCATTER operation, writing to the positions from the indices tensor +for_each(0<=n(indices, [N,W], [n,w]) + assert(0<=k && k(input, [N,W,C], [n,w,c]) + tensor_write(values_out, [N,K,C], [n, k, c], value) +} +---- + +*Supported Data Types:* + +|=== +|Profile|Mode|index_t|value_t + +|Any|signed 8|int32|aint8 +|Any|signed 16|int32|int16 +|Any|signed 32|int32|int32 +|MI,MT|float|int32|float +|=== -- cgit v1.2.1