aboutsummaryrefslogtreecommitdiff
path: root/verif/frameworks/tosa_verif_framework_generator.py
diff options
context:
space:
mode:
authorJerry Ge <jerry.ge@arm.com>2024-03-26 20:51:48 +0000
committerJerry Ge <jerry.ge@arm.com>2024-03-26 20:55:51 +0000
commitd5b1512b1d2cea3b87e52a0ecc123db2a7a7cad3 (patch)
tree8dd57b438402083cded82347a07e85b784ce2f92 /verif/frameworks/tosa_verif_framework_generator.py
parent42e183cae08b301083416481e7bac92f04f0ce21 (diff)
downloadreference_model-d5b1512b1d2cea3b87e52a0ecc123db2a7a7cad3.tar.gz
Add variable tensor fields for test descriptors
- Add variable_name and variable_file to the desc.json file for writing variable tensors to numpy - Add the key of num_variables in the unit test declaration to specify the number of variable tensors in the graph Signed-off-by: Jerry Ge <jerry.ge@arm.com> Change-Id: I1109f66ffed52e49dbb14f4a8aca64baa2bea622
Diffstat (limited to 'verif/frameworks/tosa_verif_framework_generator.py')
-rwxr-xr-xverif/frameworks/tosa_verif_framework_generator.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/verif/frameworks/tosa_verif_framework_generator.py b/verif/frameworks/tosa_verif_framework_generator.py
index 2a7d484..8ae0286 100755
--- a/verif/frameworks/tosa_verif_framework_generator.py
+++ b/verif/frameworks/tosa_verif_framework_generator.py
@@ -940,6 +940,7 @@ TF_OP_LIST = {
tf.float32,
]
},
+ "num_variables": 2,
},
"gru": {
"operands": (1, 0),
@@ -1445,6 +1446,12 @@ def run_unit_test(
_, test_name = os.path.split(test_dir)
+ # For specifying the number of variable tensors if the graph has any
+ try:
+ num_varaibles = op["num_variables"]
+ except KeyError:
+ num_varaibles = 0
+
# Write out test descriptor
write_test_json(
filename=os.path.join(test_dir, "test.json"),
@@ -1461,6 +1468,7 @@ def run_unit_test(
framework_exclusions=excluded_framework_list,
quantized=is_quantized,
test_name=test_name,
+ num_variables=num_varaibles,
)
except Exception as e:
msg = "Error running task: {}".format(e)