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

fix: torch.masked_fill #28740

Merged
merged 4 commits into from
Apr 30, 2024
Merged

Conversation

Kacper-W-Kozdon
Copy link
Contributor

@Kacper-W-Kozdon Kacper-W-Kozdon commented Apr 17, 2024

PR Description

Changed the way type-casting was done in the frontend. Previous implementation did not enforce keeping the input's dtype and paddle backend utilises type promotion in the function called by torch's frontend .masked_fill(). This resulted in the failure of dtype assertions and a failed paddle pytest. All of the backends use .where() to get the same results as torch.masked_fill(), with paddle's solution being probably a bit overcomplicated- but the tests for .where() are passing, so I did not want to alter that.

Potentially to-do:

  • if it's not too redundant: adding .masked_fill() for the superset behaviour (even torch backend uses .where() when .masked_fill() is called);
  • reformatting paddle's backend implementation of .where().

Related Issue

Closes #28437

Checklist

  • Did you add a function?
  • Did you add the tests?
  • Did you run your tests and are your tests passing?
  • Did pre-commit not fail on any check?
  • Did you follow the steps we provided?

Socials

@ivy-leaves ivy-leaves added the PyTorch Frontend Developing the PyTorch Frontend, checklist triggered by commenting add_frontend_checklist label Apr 17, 2024
Copy link
Contributor

@Ishticode Ishticode left a comment

Choose a reason for hiding this comment

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

lgtm. I will run a further check on this later today. Thanks for the effort and patience @Kacper-W-Kozdon :)

Copy link
Contributor

@Ishticode Ishticode left a comment

Choose a reason for hiding this comment

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

Thanks @Kacper-W-Kozdon :)

@Ishticode Ishticode merged commit 6e7807c into ivy-llc:main Apr 30, 2024
153 of 157 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PyTorch Frontend Developing the PyTorch Frontend, checklist triggered by commenting add_frontend_checklist
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix Frontend Failing Test: paddle - tensor.torch.Tensor.masked_fill
3 participants