Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Torch] add aten.bilinear op decomposing #3931

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dixinzhou
Copy link
Contributor

This PR adds support for aten.bilinear op. The aten.bilinear op is decomposed to aten._trilinear and aten.add according to https://github.com/pytorch/pytorch/blob/main/aten/src/ATen/native/Linear.cpp#L712.

Additionally, this PR fixes a bug in aten._trilinear op decomposition about tensor shape mismatch.

@dixinzhou
Copy link
Contributor Author

Hi @vivekkhandelwal1. I don't have permission to request review yet. Do you mind taking a look at this change? Thanks!

@@ -7655,6 +7678,78 @@ class DecomposeAtenLinearOp : public OpRewritePattern<AtenLinearOp> {
};
} // namespace

namespace {
// Decompose `aten.bilinear` op into `aten._trilinear` and `aten.add` ops.
class DecomposeAtenBilinearOp : public OpRewritePattern<AtenBilinearOp> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please add some code-snippet as comment here to show how the decomposition looks like?

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.

2 participants