From 18548921437ef60e5553a75517449918e5c42b1d Mon Sep 17 00:00:00 2001 From: Kevin Petit Date: Fri, 17 Mar 2023 17:12:30 +0000 Subject: SCATTER/GATHER: Replace value_t with in_out_t Most operators use in_out_t. This removes a special case. Signed-off-by: Kevin Petit Change-Id: Icfc86f1101d250700677959949bda466519152de --- chapters/scatter_gather.adoc | 12 ++++++------ tosa.xml | 38 +++++++++++++++++++------------------- tosa.xsd | 2 -- 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/chapters/scatter_gather.adoc b/chapters/scatter_gather.adoc index 89942f2..1dbda4f 100644 --- a/chapters/scatter_gather.adoc +++ b/chapters/scatter_gather.adoc @@ -21,8 +21,8 @@ include::{generated}/operators/GATHER.adoc[] for_each(0 <= n < N, 0 <= w < W, 0 <= c < C) { index_t k = tensor_read(indices, [N,W], [n,w]); REQUIRE(0 <= k && k < K); - value_t value = tensor_read(values, [N,K,C], [n,k,c]); - tensor_write(output, [N,W,C], [n,w,c], value); + in_out_t value = tensor_read(values, [N,K,C], [n,k,c]); + tensor_write(output, [N,W,C], [n,w,c], value); } ---- @@ -45,8 +45,8 @@ bool_t output_modified[N,K,C]; // Copy the values_in tensor to the values_out tensor. // Values not written by the scatter operation are unchanged in the output. for_each(0 <= n < N, 0 <= k < K, 0 <= c < C) { - value_t value = tensor_read(values_in, [N,K,C], [n,k,c]); - tensor_write(values_out, [N,K,C], [n, k, c], value); + in_out_t value = tensor_read(values_in, [N,K,C], [n,k,c]); + tensor_write(values_out, [N,K,C], [n, k, c], value); output_modified[n,k,c]=false; } @@ -55,8 +55,8 @@ for_each(0 <= n < N, 0 <= w < W, 0 <= c < C) { index_t k = tensor_read(indices, [N,W], [n,w]); REQUIRE(0 <= k && k < K); REQUIRE(output_modified[n,k,c] == false); - value_t value = tensor_read(input, [N,W,C], [n,w,c]); - tensor_write(values_out, [N,K,C], [n, k, c], value); + in_out_t value = tensor_read(input, [N,W,C], [n,w,c]); + tensor_write(values_out, [N,K,C], [n, k, c], value); output_modified[n,k,c] = true; } ---- diff --git a/tosa.xml b/tosa.xml index dbf1604..00012ad 100644 --- a/tosa.xml +++ b/tosa.xml @@ -1892,31 +1892,31 @@ used. GATHER - + 3D value tensor 2D index tensor - + 3D output tensor - + - - - - + + + + - + - + @@ -1924,34 +1924,34 @@ used. SCATTER - + 3D values in tensor 2D index tensor - + 3D input tensor - + 3D output tensor - + - - - - + + + + - + - + diff --git a/tosa.xsd b/tosa.xsd index 6f0d3b5..7bf2c40 100644 --- a/tosa.xsd +++ b/tosa.xsd @@ -51,7 +51,6 @@ - @@ -174,7 +173,6 @@ - -- cgit v1.2.1