This issue has not repro case, it just points out the issue.
aten::conv3d has the following code when bias is missing:
|
if bias is None: |
|
weight_dim_0 = op.Shape(weight, start=0, end=1) |
|
bias_shape = op.Concat(weight_dim_0, op.Constant(value_ints=[2]), axis=0) |
|
zero = op.CastLike(0.0, input) |
|
bias = op.Expand(zero, bias_shape) |
This code is copy-pasted for the aten::conv3d_complex code:
|
if bias is None: |
|
weight_dim_0 = op.Shape(weight, start=0, end=1) |
|
bias_shape = op.Concat(weight_dim_0, op.Constant(value_ints=[2]), axis=0) |
|
zero = op.CastLike(0.0, input) |
|
bias = op.Expand(zero, bias_shape) |
and it therefore generates a 2D bias, which is incorrect for non-complex conv3d. This will cause downstream issues.
the aten::conv1d and aten:::conv2d onnx export is correct, and that code should be used instead:
|
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) |
This issue has not repro case, it just points out the issue.
aten::conv3d has the following code when bias is missing:
onnxscript/onnxscript/function_libs/torch_lib/ops/core.py
Lines 2128 to 2132 in c72e810
This code is copy-pasted for the aten::conv3d_complex code:
onnxscript/onnxscript/function_libs/torch_lib/ops/core.py
Lines 2173 to 2177 in c72e810
and it therefore generates a 2D bias, which is incorrect for non-complex conv3d. This will cause downstream issues.
the aten::conv1d and aten:::conv2d onnx export is correct, and that code should be used instead:
onnxscript/onnxscript/function_libs/torch_lib/ops/core.py
Lines 2038 to 2042 in c72e810