[ref model] Change RescaleOp attrs to inputs
This patch implements changes required for RescaleOp's
multiplier and shift changing from attributes to inputs
Signed-off-by: Tai Ly <tai.ly@arm.com>
Change-Id: I178919727e3220c749dad0ebce141e695868fee0
diff --git a/verif/generator/tosa_utils.py b/verif/generator/tosa_utils.py
index 31a0ff0..384463f 100644
--- a/verif/generator/tosa_utils.py
+++ b/verif/generator/tosa_utils.py
@@ -55,6 +55,14 @@
FIXED_DATA = 5
+def dtypeWidth(dtype):
+ """Get the datatype width for data types"""
+ if dtype in DTYPE_ATTRIBUTES:
+ return DTYPE_ATTRIBUTES[dtype]["width"]
+ else:
+ raise Exception(f"Unknown dtype, cannot determine width: {dtype}")
+
+
def dtypeIsSupportedByCompliance(dtype):
"""Types supported by the new data generation and compliance flow."""
if isinstance(dtype, list) or isinstance(dtype, tuple):