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


My python environment is anaconda.
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.
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"?
Also, note that you can do # type: ignore on a specific line if you want to suppress that line's type errors.
@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.
Closing in favor of #150, which is covering general numpy support.
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).
They are in their repo, a mix of stubs and inline annotations: https://github.com/pytorch/pytorch

The same. It is still not solved.
@AgentIvan This issue is a dupe of #150 (which is not closed); you can follow there.
Most helpful comment
Also, note that you can do
# type: ignoreon a specific line if you want to suppress that line's type errors.