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: fixed frontend function torch.mean for all backends #28568

Merged
merged 1 commit into from
Mar 16, 2024

Conversation

ZenithFlux
Copy link
Contributor

@ZenithFlux ZenithFlux commented Mar 12, 2024

PR Description

  • Fixed data type conversion occuring due to incorrect input_dtype supplied to test_frontend_function.
  • Added @with_supported_dtypes to frontend function torch.mean.

Related Issue

Closes #28563
Closes #28564
Closes #28565
Closes #28566

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?

@ivy-leaves ivy-leaves added the PyTorch Frontend Developing the PyTorch Frontend, checklist triggered by commenting add_frontend_checklist label Mar 12, 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.

Hi @ZenithFlux
Thanks for the PR :)

@@ -480,6 +480,7 @@ def test_torch_mean(
backend_fw,
):
input_dtype, x, axis, *_ = dtype_and_x
assume("float" in input_dtype[0] or "complex" in input_dtype[0])
Copy link
Contributor

Choose a reason for hiding this comment

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

why does it need to assume this when the dtypes are already specified to be float_and_complex?
ideally we shouldn't need filtering etc. any dtypes in test but rather on the functions with un/supporteded_dtype decorators.

Copy link
Contributor Author

@ZenithFlux ZenithFlux Mar 14, 2024

Choose a reason for hiding this comment

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

Sorry my bad. I've made the corrections.

Fixed data type conversion occuring due to incorrect input_dtype supplied to test_frontend_function.
Added `@with_supported_dtypes` to frontend function `torch.mean`.
@ZenithFlux ZenithFlux force-pushed the chaitanya/fixing_test_torch_mean branch from d72ed38 to 85773ed Compare March 14, 2024 14:29
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.

Thank @ZenithFlux
failures seem unrelated.
Thank you very much :)

@Ishticode Ishticode merged commit 6082f27 into ivy-llc:main Mar 16, 2024
203 of 281 checks passed
@ZenithFlux ZenithFlux deleted the chaitanya/fixing_test_torch_mean branch March 18, 2024 09:30
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
3 participants