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 using of deprecated inspect.getargspec() function #27907

Merged
merged 1 commit into from
Jan 13, 2024

Conversation

Sai-Suraj-27
Copy link
Contributor

@Sai-Suraj-27 Sai-Suraj-27 commented Jan 12, 2024

PR Description

In the following line, inspect.getargspect() is used,
https://github.com/unifyai/ivy/blob/66e0c4905908633fa1b2966d6da05a183c9f40d5/ivy/functional/frontends/torch/utilities.py#L30
The getargspec() function is deprecated since Python 3.0; use inspect.signature() or inspect.getfullargspec() instead.

For reference:
https://docs.python.org/3/library/inspect.html#inspect.getfullargspec

Related Issue

Closes #27906

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 Jan 12, 2024
@KareemMAX
Copy link
Contributor

Hey @YushaArif99, I'm not sure if this function have the same signature. Can you confirm that before we merge?

@Sai-Suraj-27
Copy link
Contributor Author

Hey @YushaArif99, I'm not sure if this function have the same signature. Can you confirm that before we merge?

It is deprecated from python 3.0 and removed from 3.11 (https://docs.python.org/3/whatsnew/3.11.html#removed)

It has the same signature, for more information/reference:

  1. inspect.getargspec() is deprecated in Python 3 pytorch/pytorch#15344
  2. pytorch/pytorch@614121c

In our codebase also, at all the other places inspect.getfullargspec() is used, except at this place.

Copy link
Contributor

@NripeshN NripeshN left a comment

Choose a reason for hiding this comment

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

LGTM!

@NripeshN NripeshN merged commit c993756 into Transpile-AI:main Jan 13, 2024
405 of 417 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.

inspect.getargspec() is deprecated, instead use inspect.getfullargspec()
5 participants