Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tf2onnx/onnx_opset/nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def any_version(cls, opset, ctx, node, **kwargs):

# prefix with batch dim of [1] to satisfy rank requirements
input_shape = ctx.get_shape(node.input[0])
if len(input_shape) == spatial + 1:
if input_shape is not None and len(input_shape) == spatial + 1:
gb = GraphBuilder(ctx)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly I'm not sure why this condition is here and if it ever triggers. The unit tests I tried don't run it.

usq_node = gb.make_unsqueeze({"axes": [0], 'data': node.input[0]}, return_node=True)
ctx.replace_inputs(node, [usq_node.output[0]] + node.input[1:])
Expand Down