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/type_conversion.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/type_conversion.adoc')
-rw-r--r-- | chapters/type_conversion.adoc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/chapters/type_conversion.adoc b/chapters/type_conversion.adoc index 2ca505e..35cebe7 100644 --- a/chapters/type_conversion.adoc +++ b/chapters/type_conversion.adoc @@ -103,9 +103,9 @@ Rescale quantized values into a new domain. This function scales by factor: mult [source,c++] ---- for_each(index in shape) { - assert(in_t == int8_t || in_t == uint8_t || input_zp == 0); - assert(out_t == int8_t || out_t == uint8_t || output_zp == 0); - assert((scale32 && in_t != int48_t_t) || (!scale32 && !double_round)); + REQUIRE(in_t == int8_t || in_t == uint8_t || input_zp == 0); + REQUIRE(out_t == int8_t || out_t == uint8_t || output_zp == 0); + REQUIRE((scale32 && in_t != int48_t_t) || (!scale32 && !double_round)); int48_t value = tensor_read<in_t>(input, shape, index, input_zp); int c = (per_channel) ? index[dims-1] : 0; int32_t result = (scale32) ? |