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/data_layout.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/data_layout.adoc')
-rw-r--r-- | chapters/data_layout.adoc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/chapters/data_layout.adoc b/chapters/data_layout.adoc index de90322..09df5be 100644 --- a/chapters/data_layout.adoc +++ b/chapters/data_layout.adoc @@ -121,7 +121,7 @@ Returns a tensor with the same type/values as the input, with a new shape specif [source,c++] ---- -assert(tensor_size(shape1) == tensor_size(shape)); +REQUIRE(tensor_size(shape1) == tensor_size(shape)); for(i = 0; i < tensor_size(shape); i++) { output[i] = input[i]; } @@ -157,7 +157,7 @@ Returns a tensor with the same type/values as the input, with the data reversed [source,c++] ---- -assert(0 <= axis && axis < rank(shape)); +REQUIRE(0 <= axis && axis < rank(shape)); for_each(index in shape) { tmp_index = index; tmp_index[axis] = shape[axis] - 1 - index[axis]; @@ -240,7 +240,7 @@ Replicates input1 multiplies times along each dimension. for_each(index in shape) { tmp_index = index; for(i = 0; i < rank(shape); i++) { - assert(shape1[i] * multiplies[i] == shape[i]); + REQUIRE(shape1[i] * multiplies[i] == shape[i]); tmp_index[i] = index[i] % shape1[i]; } in_t value = tensor_read<in_t>(input, shape1, tmp_index); @@ -281,7 +281,7 @@ Permutes the dimensions based on perm. for_each(index in shape) { tmp_index = index; for(i = 0; i < rank(shape); i++) { - assert(shape1[perm[i]] == shape[i]) + REQUIRE(shape1[perm[i]] == shape[i]) tmp_index[perm[i]] = index[i] } in_t value = tensor_read<in_t>(input, shape1, tmp_index); |