aboutsummaryrefslogtreecommitdiff
path: root/verif/frameworks/write_test_json.py
diff options
context:
space:
mode:
authorTatWai Chong <tatwai.chong@arm.com>2024-01-12 13:13:22 -0800
committerEric Kunze <eric.kunze@arm.com>2024-01-23 22:05:26 +0000
commit6a46b251062dcd42bc9fa2bc9effad407747f64f (patch)
treeea4d74e6bfa643aa9d18f74491a59940dbc3b281 /verif/frameworks/write_test_json.py
parent64e4bfe627ded0ba44ff60b23db28c1ff5d73d13 (diff)
downloadreference_model-6a46b251062dcd42bc9fa2bc9effad407747f64f.tar.gz
Shape infer dynamic model to static model prior to execution.
Dynamic shape model cannot directly run on the refenence model as the concrete size of tensor is unknown therefore the volume of tensor is not able to be allocated. Furthemore, the operators also expect the input model is static-shaped. This change turns dynamic model to static model prior to execution. - Add `ifm_dynamic` field into json description to indicate whether the model has dynamic shape or not. - Add the shape inference pass into the compilation pipeline, firstly legalize the dynamic tf/tfl model to dynamic tosa model with unknown shapes, and then run the shape inference pass with static shapes input argument to resolve unknown dimensions. Change-Id: I5d2ffd452becc562dc30546789705bd01dd7a0b0 Signed-off-by: TatWai Chong <tatwai.chong@arm.com>
Diffstat (limited to 'verif/frameworks/write_test_json.py')
-rw-r--r--verif/frameworks/write_test_json.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/verif/frameworks/write_test_json.py b/verif/frameworks/write_test_json.py
index d52a777..4e3aa40 100644
--- a/verif/frameworks/write_test_json.py
+++ b/verif/frameworks/write_test_json.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2020-2022, ARM Limited.
+# Copyright (c) 2020-2024, ARM Limited.
# SPDX-License-Identifier: Apache-2.0
import json
@@ -16,6 +16,7 @@ def write_test_json(
ifm_name=None,
ifm_file=None,
ifm_shape=None,
+ ifm_dynamic=False,
framework_exclusions=None,
quantized=False,
test_name=None,
@@ -60,6 +61,9 @@ def write_test_json(
ifm_shape = [ifm_shape]
test_desc["ifm_shape"] = ifm_shape
+ if ifm_dynamic:
+ test_desc["ifm_dynamic"] = True
+
# Some tests cannot be used with specific frameworks.
# This list indicates which tests should be excluded from a given framework.
if framework_exclusions: