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

function is not a known member of module in numpy. reportGeneralTypeIssues #106

Closed
lepecoder opened this issue Jul 14, 2020 · 9 comments
Closed
Labels
enhancement New feature or request

Comments

@lepecoder
Copy link

When I use numpy or torch etc, the Pylance alert that some function is not a known member of module.

批注 2020-07-14 171840
批注 2020-07-14 172240

My python environment is anaconda.

@johnybx
Copy link

johnybx commented Jul 14, 2020

Same goes for sqlalchemy objects where for example session methods like commit or add are unrecognized (probably dynamic methods based on database type). Maybe this could be at least split to independent diagnostics which can be turned off or severity level could be overridden independently.

@jakebailey
Copy link
Member

You have a type checking mode enabled, which means you're going to get more errors for untyped code or potentially missing types. See #93 for numpy; most of numpy is compiled and we don't have the information from compiled modules.

PyTorch ships with annotations and stubs, if you believe the signature for FloatTensor's constructor to be wrong you may want to file a bug on their tracker.

@johnybx This diagnostic is disabled by default (type checking mode "off"). I assume you mean when the mode is not just "off"?

@jakebailey
Copy link
Member

Also, note that you can do # type: ignore on a specific line if you want to suppress that line's type errors.

@judej judej added the enhancement New feature or request label Jul 14, 2020
@johnybx
Copy link

johnybx commented Jul 14, 2020

@jakebailey I mean that I would like to have checking mode basic but I would like to have diagnostic "x" is not a known member of module set as information not error as most of these messages are displayed for modules which which I do not develop so it would be nice if it wasn't reportGeneralTypeIssues but some independent class of issue. I think it would be much better user experience if we could distinguish these errors based on severity level set.

@jakebailey
Copy link
Member

Closing in favor of #150, which is covering general numpy support.

@alexeyr
Copy link

alexeyr commented Sep 2, 2020

PyTorch ships with annotations and stubs, if you believe the signature for FloatTensor's constructor to be wrong you may want to file a bug on their tracker.

My question would be where to find these stubs (at least for torch module itself).

@jakebailey
Copy link
Member

They are in their repo, a mix of stubs and inline annotations: https://github.com/pytorch/pytorch

@AgentIvan
Copy link

image
The same. It is still not solved.

@jakebailey
Copy link
Member

@AgentIvan This issue is a dupe of #150 (which is not closed); you can follow there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants