Skip to content

Fixed Conv3DTranspose with strides for data format channels_first (fixes #1714)#1748

Closed
fthielke wants to merge 3 commits intoonnx:mainfrom
fthielke:fix_convtranspose_channels_first
Closed

Fixed Conv3DTranspose with strides for data format channels_first (fixes #1714)#1748
fthielke wants to merge 3 commits intoonnx:mainfrom
fthielke:fix_convtranspose_channels_first

Conversation

@fthielke
Copy link
Copy Markdown
Contributor

While shape calculations for the input correctly distinguished between channels_first and channels_last, shape calculations for the inputs of the final Slice and Pad nodes always assumed channels_last format.

Comment thread tf2onnx/onnx_opset/nn.py Outdated
{"data": output_shape.output[0], "ends": [sp_index_start+3], "starts": [sp_index_start+2], "axes": [0]})
expect_d = GraphBuilder(ctx).make_slice(
{"data": input_shape.output[0], "ends": [4], "starts": [3], "axes": [0]})
{"data": input_shape.output[0], "ends": [sp_index_start+3], "starts": [sp_index_start+2], "axes": [0]})
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

pylint is complaining that line and 533 are too long.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

Comment thread tf2onnx/onnx_opset/nn.py
 onnx#1714)

While shape calculations for the input correctly distinguished between channels_first and channels_last, shape calculations for the inputs of the final Slice and Pad nodes always assumed channels_last format.

Signed-off-by: fthielke <[email protected]>
@fthielke fthielke force-pushed the fix_convtranspose_channels_first branch from 373519e to a4327e1 Compare November 22, 2021 16:09
Comment thread tf2onnx/onnx_opset/nn.py Outdated
sp_index_start = 1 if is_channels_last(node) else 2
output_h = GraphBuilder(ctx).make_slice(
{"data": output_shape.output[0], "ends": [2], "starts": [1], "axes": [0]})
{"data": output_shape.output[0], "ends": [sp_index_start+1], "starts": [sp_index_start], "axes": [0]})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @fthielke , please fix the pyline issues.

@hwangdeyu hwangdeyu self-assigned this Feb 11, 2022
@hwangdeyu
Copy link
Copy Markdown
Contributor

@fthielke Let me know if you have any questions.

@hwangdeyu hwangdeyu closed this Mar 16, 2022
@hwangdeyu hwangdeyu reopened this Mar 16, 2022
@fatcat-z fatcat-z added the pending on user response Waiting for more information or validation from user label Apr 6, 2022
@fthielke fthielke closed this Sep 16, 2025
@fthielke fthielke deleted the fix_convtranspose_channels_first branch September 16, 2025 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending on user response Waiting for more information or validation from user

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants