diff options
author | Eric Kunze <eric.kunze@arm.com> | 2021-06-17 18:01:09 -0700 |
---|---|---|
committer | Eric Kunze <eric.kunze@arm.com> | 2021-06-24 12:18:14 -0700 |
commit | a9101530d8ea7a3cb470b722bc6cf8745ab283ac (patch) | |
tree | 2918f0c0e16515295ef6d112c279902fdddd44fb /chapters/scatter_gather.adoc | |
parent | f19e594f71e04c72ecf937419333b57dc7dcb873 (diff) | |
download | specification-a9101530d8ea7a3cb470b722bc6cf8745ab283ac.tar.gz |
Replace assert with REQUIRE()
REQUIRE is a direct replacement for the asserts, and uses
the unpredictable() function in pseudocode to describe the required
conditions for operators
Change-Id: I35dc81e083d8e41f16728d992bdb8b06b0271226
Signed-off-by: Eric Kunze <eric.kunze@arm.com>
Diffstat (limited to 'chapters/scatter_gather.adoc')
-rw-r--r-- | chapters/scatter_gather.adoc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/chapters/scatter_gather.adoc b/chapters/scatter_gather.adoc index a657f55..6fedb45 100644 --- a/chapters/scatter_gather.adoc +++ b/chapters/scatter_gather.adoc @@ -34,7 +34,7 @@ None ---- 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); + REQUIRE(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], value); } @@ -93,8 +93,8 @@ for_each(0 <= n < N, 0 <= k < K, 0 <= c < C) { // Now perform the SCATTER operation, modifying the positions from the indices tensor 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); - assert(output_modified[n,k,c] == false); + REQUIRE(0 <= k && k < K); + REQUIRE(output_modified[n,k,c] == false); value_t value = tensor_read<value_t>(input, [N,W,C], [n,w,c]); tensor_write<value_t>(values_out, [N,K,C], [n, k, c], value); output_modified[n,k,c] = true; |