diff options
author | Tai Ly <tai.ly@arm.com> | 2024-03-01 20:59:32 +0000 |
---|---|---|
committer | Eric Kunze <eric.kunze@arm.com> | 2024-03-06 18:27:07 +0000 |
commit | 6e1e2bc06bff785e87577f24064bbc846300f8fd (patch) | |
tree | 0a96aeac6f88799fbc297e5937cc0ffc44adcfff /verif/generator/tosa_utils.py | |
parent | 1d5ddeda5d853642fe3b2eade7d765386727021f (diff) | |
download | reference_model-6e1e2bc06bff785e87577f24064bbc846300f8fd.tar.gz |
[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
Diffstat (limited to 'verif/generator/tosa_utils.py')
-rw-r--r-- | verif/generator/tosa_utils.py | 8 |
1 files changed, 8 insertions, 0 deletions
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 @@ class DataGenType(IntEnum): 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): |