aboutsummaryrefslogtreecommitdiff
path: root/chapters/type_conversion.adoc
diff options
context:
space:
mode:
Diffstat (limited to 'chapters/type_conversion.adoc')
-rw-r--r--chapters/type_conversion.adoc9
1 files changed, 5 insertions, 4 deletions
diff --git a/chapters/type_conversion.adoc b/chapters/type_conversion.adoc
index 35cebe7..b4d372d 100644
--- a/chapters/type_conversion.adoc
+++ b/chapters/type_conversion.adoc
@@ -93,7 +93,7 @@ Rescale quantized values into a new domain. This function scales by factor: mult
|Attribute|out_t|output_zp|-|Output tensor zero point
|Input (MT profile) Attribute (BI/MI profiles)|mul_t|multiplier[NC]|-|Scaling multiplier array
|Input (MT profile) Attribute (BI/MI profiles)|uint6_t|shift[NC] |-|Scaling shift array
-|Input (MT profile) Attribute (BI/MI profiles)|bool_t|scale32|-|if (scale32) mul_t=int32_t else mul_t=int16_t
+|Attribute|bool_t|scale32|-|if (scale32) mul_t=int32_t else mul_t=int16_t
|Attribute|bool_t|double_round|-|Select double round mode
|Attribute|bool_t|per_channel|-|if (per_channel) NC=shape[dims-1] else NC=1
|===
@@ -103,9 +103,10 @@ Rescale quantized values into a new domain. This function scales by factor: mult
[source,c++]
----
for_each(index in shape) {
- 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));
+ ERROR_IF(in_t != int8_t && in_t != uint8_t && input_zp != 0);
+ ERROR_IF(out_t != int8_t && out_t != uint8_t && output_zp != 0);
+ ERROR_IF(scale32 && int_t == int48_t);
+ ERROR_IF(!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) ?