From 586a080a625a9df4f3f1d5622cba8be5ce4aec18 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Wed, 21 Jun 2023 08:35:03 +0000 Subject: [PATCH] Pin minimum dim size for random data to 1 --- src/deepsparse/utils/onnx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/deepsparse/utils/onnx.py b/src/deepsparse/utils/onnx.py index 7f10488bc0..d3805f4ba3 100644 --- a/src/deepsparse/utils/onnx.py +++ b/src/deepsparse/utils/onnx.py @@ -194,7 +194,7 @@ def generate_random_inputs( for i, external_input in enumerate(get_external_inputs(onnx_filepath)): input_tensor_type = external_input.type.tensor_type elem_type = translate_onnx_type_to_numpy(input_tensor_type.elem_type) - in_shape = [int(d.dim_value) for d in input_tensor_type.shape.dim] + in_shape = [max(int(d.dim_value), 1) for d in input_tensor_type.shape.dim] if batch_size is not None: in_shape[0] = batch_size