torch.nn.Linear wrong type annotation for bias #68179
Labels
module: nn
Related to torch.nn
module: typing
Related to mypy type annotations
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Uh oh!
There was an error while loading. Please reload this page.
🐛 Bug
It seems that
torch.nn.Linear
gives wrong type annotation for bias:Expect
NoneType
, but gettorch.nn.parameter.Parameter
.To Reproduce
I am using PyTorch 1.9.0.
Expected behavior
torch.nn.Linear.bias
should beUnion[types.NoneType, torch.nn.parameter.Parameter]
, or have atorch.nn.LinearNoBias
as a subclass?Environment
Please copy and paste the output from our
environment collection script
(or fill out the checklist below manually).
You can get the script and run it with:
conda
,pip
, source): pipcc @albanD @mruberry @jbschlosser @walterddr @ezyang @malfet @rgommers @xuzhao9 @gramster
The text was updated successfully, but these errors were encountered: