Skip to content

Commit 421b6c5

Browse files
authored
AC: fix dynamic shapes template resolving for CHW (#2940)
1 parent 104ff78 commit 421b6c5

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

tools/accuracy_checker/openvino/tools/accuracy_checker/launcher/dlsdk_launcher.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,12 @@ def fit_to_input(self, data, layer_name, layout, precision, template=None):
742742
def _data_to_blob_dyn(layer_rang, data, layout, template=None):
743743
data_shape = np.shape(data)
744744
if len(data_shape) - layer_rang == 1 and data_shape[0] == 1:
745+
if len(data_shape) == len(layout):
746+
data = np.transpose(data, layout)
747+
if len(template) == layer_rang:
748+
tmp_template = [1, ] + template
749+
new_template = [tmp_template[l_dim] for l_dim in layout][1:]
750+
template = new_template
745751
data = data[0]
746752
data_shape = np.shape(data)
747753
if template is not None:

tools/accuracy_checker/openvino/tools/accuracy_checker/launcher/openvino_launcher.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,12 @@ def fit_to_input(self, data, layer_name, layout, precision, template=None):
679679
def _data_to_blob_dyn(layer_rang, data, layout, template=None):
680680
data_shape = np.shape(data)
681681
if len(data_shape) - layer_rang == 1 and data_shape[0] == 1:
682+
if len(data_shape) == len(layout):
683+
data = np.transpose(data, layout)
684+
if len(template) == layer_rang:
685+
tmp_template = [1, ] + template
686+
new_template = [tmp_template[l_dim] for l_dim in layout][1:]
687+
template = new_template
682688
data = data[0]
683689
data_shape = np.shape(data)
684690
if template is not None:

0 commit comments

Comments
 (0)