Add INT48 and INT4 datatype support to IDENTITY
Added support to ref model and testing
Signed-off-by: evacha01 <evan.chandler@arm.com>
Change-Id: Iece53d07c8986332fdd8f1ce5ed6265349df1b6a
diff --git a/verif/conformance/tosa_base_profile_ops_info.json b/verif/conformance/tosa_base_profile_ops_info.json
index c8f3442..25a6076 100644
--- a/verif/conformance/tosa_base_profile_ops_info.json
+++ b/verif/conformance/tosa_base_profile_ops_info.json
@@ -1795,12 +1795,16 @@
"generator_args": [
[
"--target-dtype",
+ "int4",
+ "--target-dtype",
"int8",
"--target-dtype",
"int16",
"--target-dtype",
"int32",
"--target-dtype",
+ "int48",
+ "--target-dtype",
"bool",
"--tensor-dim-range",
"1,61",
@@ -1813,12 +1817,16 @@
],
[
"--target-dtype",
+ "int4",
+ "--target-dtype",
"int8",
"--target-dtype",
"int16",
"--target-dtype",
"int32",
"--target-dtype",
+ "int48",
+ "--target-dtype",
"bool",
"--tensor-dim-range",
"1,15",
diff --git a/verif/generator/tosa_test_gen.py b/verif/generator/tosa_test_gen.py
index a1f54c6..4309024 100644
--- a/verif/generator/tosa_test_gen.py
+++ b/verif/generator/tosa_test_gen.py
@@ -191,6 +191,8 @@
if dtype == DType.BOOL:
return np.bool_(self.rng.choice(a=[False, True], size=shape))
+ elif dtype == DType.INT4:
+ return np.int8(self.rng.integers(low=low, high=high, size=shape))
elif dtype == DType.INT8:
return np.int8(self.rng.integers(low=low, high=high, size=shape))
elif dtype == DType.UINT8:
@@ -4652,7 +4654,7 @@
TosaTensorValuesGen.tvgLazyGenDefault,
TosaArgGen.agNone,
),
- "types": TYPE_FIB,
+ "types": TYPE_FIB + [DType.INT4, DType.INT48],
"data_gen": {
"fp": (gtu.DataGenType.PSEUDO_RANDOM,),
},