Skip to content

[PyTorch][Frontend] Semantic difference of 'bias_add' between relay and pytorch#9204

Merged
masahi merged 3 commits intoapache:mainfrom
soodoshll:fix-bias_add
Oct 7, 2021
Merged

[PyTorch][Frontend] Semantic difference of 'bias_add' between relay and pytorch#9204
masahi merged 3 commits intoapache:mainfrom
soodoshll:fix-bias_add

Conversation

@soodoshll
Copy link
Copy Markdown
Contributor

@soodoshll soodoshll commented Oct 6, 2021

Greetings. I encountered a problem when trying translating Pytorch models into relay. relay.nn.bias_add has a default axis=1, which is inconsistent with linear in PyTorch (when ndim>2), which always adds bias to the last dimension. So it is necessary to explicitly assign axis=-1 here.

Thanks @spectrometerHBH for helping debug. cc @junrushao1994

@masahi
Copy link
Copy Markdown
Member

masahi commented Oct 6, 2021

Thanks, can you add a test?

Copy link
Copy Markdown
Member

@junrushao junrushao left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the bugfix!

@soodoshll
Copy link
Copy Markdown
Contributor Author

@masahi Hi, test is also fixed.

@masahi masahi merged commit 26c3510 into apache:main Oct 7, 2021
@masahi
Copy link
Copy Markdown
Member

masahi commented Oct 7, 2021

Thanks @soodoshll

ylc pushed a commit to ylc/tvm that referenced this pull request Jan 7, 2022
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants