-
Notifications
You must be signed in to change notification settings - Fork 93
Closed
Labels
bugSomething isn't workingSomething isn't workingcontribution welcomeWe welcome code contributions for thisWe welcome code contributions for thismodule: torchlibRelated to the torch/aten function lib in developmentRelated to the torch/aten function lib in development
Description
In some exported model with ConvTranspose I'm seeing the wrong shape for bias:


where B should have shape (128) instead of (256) according to the ONNX spec.
Looking at the onnxscript code, the problem seems to be that since
_aten_convolution_onnx() is used for both Conv and ConvTranspose, the logic for filling in bias should check the 0th dimension of weight if it's Conv and the 1st dimension of weight if it's ConvTranspose:
if bias is None:
weight_dim_0 = op.Shape(weight, start=0, end=1)
bias_shape = op.Expand(weight_dim_0, op.Constant(value_ints=[1]))
zero = op.CastLike(0.0, input)
bias = op.Expand(zero, bias_shape)
I think the value of groups is also needed since the shape of weight is (M x C/group x kH x kW) for Conv and (C x M/group x kH x kW) for ConvTranspose?
justinchuby
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcontribution welcomeWe welcome code contributions for thisWe welcome code contributions for thismodule: torchlibRelated to the torch/aten function lib in developmentRelated to the torch/aten function lib in development