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 raising TypeError exception instead or ValueError exception for invalid type #27439

Merged
merged 2 commits into from
Dec 4, 2023

Conversation

Sai-Suraj-27
Copy link
Contributor

@Sai-Suraj-27 Sai-Suraj-27 commented Dec 4, 2023

PR Description

In few places in the codebase, We are raising ValueError upon encountering an inappropriate type. It is more appropriate to raise TypeError instead of ValueError at these places:
https://github.com/unifyai/ivy/blob/6a7517784ea9c062b3735def4bb81c10d8989078/ivy/functional/frontends/numpy/fft/discrete_fourier_transform.py#L34
https://github.com/unifyai/ivy/blob/6a7517784ea9c062b3735def4bb81c10d8989078/ivy/functional/frontends/numpy/fft/discrete_fourier_transform.py#L138
https://github.com/unifyai/ivy/blob/6a7517784ea9c062b3735def4bb81c10d8989078/ivy/functional/frontends/paddle/nn/functional/vision.py#L121
https://github.com/unifyai/ivy/blob/6a7517784ea9c062b3735def4bb81c10d8989078/ivy/functional/frontends/paddle/nn/functional/vision.py#L175

Related Issue

Closes #27438

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 JAX Frontend Developing the JAX Frontend, checklist triggered by commenting add_frontend_checklist NumPy Frontend Developing the NumPy Frontend, checklist triggered by commenting add_frontend_checklist Paddle Frontend Developing the Paddle Frontend, checklist triggered by commenting add_frontend_checklist PyTorch Frontend Developing the PyTorch Frontend, checklist triggered by commenting add_frontend_checklist labels Dec 4, 2023
@KareemMAX KareemMAX merged commit 08bd6dc into ivy-llc:main Dec 4, 2023
648 of 685 checks passed
Kacper-W-Kozdon pushed a commit to Kacper-W-Kozdon/ivy that referenced this pull request Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JAX Frontend Developing the JAX Frontend, checklist triggered by commenting add_frontend_checklist NumPy Frontend Developing the NumPy Frontend, checklist triggered by commenting add_frontend_checklist Paddle Frontend Developing the Paddle Frontend, checklist triggered by commenting add_frontend_checklist 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.

Prefer TypeError exception for invalid type
4 participants