Skip to content

Commit 7aa8ac4

Browse files
authored
Pin minimum dim size for random data to 1 (#1086)
1 parent 59615dd commit 7aa8ac4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/deepsparse/utils/onnx.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def generate_random_inputs(
194194
for i, external_input in enumerate(get_external_inputs(onnx_filepath)):
195195
input_tensor_type = external_input.type.tensor_type
196196
elem_type = translate_onnx_type_to_numpy(input_tensor_type.elem_type)
197-
in_shape = [int(d.dim_value) for d in input_tensor_type.shape.dim]
197+
in_shape = [max(int(d.dim_value), 1) for d in input_tensor_type.shape.dim]
198198

199199
if batch_size is not None:
200200
in_shape[0] = batch_size

0 commit comments

Comments
 (0)