Skip to content

Commit de790ca

Browse files
committed
Again allow for None in target shape--for pytorch
1 parent c5841a2 commit de790ca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hls4ml/model/layers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,9 @@ def initialize(self):
402402
else:
403403
raise RuntimeError("Reshape for ONNX requires the target shape to be a second input.")
404404

405-
# nones should not exist here
405+
# remove Nones -- Seems to be used by pytorch parser
406406
if target_shape[0] is None:
407-
raise RuntimeError(f"Unexpectedly have a None in {target_shape=}")
407+
target_shape = target_shape[1:]
408408

409409
# take care of -1 shapes
410410
shape = self._infer_output_shape(input_shape, target_shape)

0 commit comments

Comments
 (0)