You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Currently pytorch type annotates all of its nn.Module class as returning typing.Any which isn't helpful. When you try to define your forward method and type annotate it that doesn't reflect to call of the class as mentioned in this issue (https://discuss.pytorch.org/t/adding-typing-to-call-of-nn-module/118295). Please look into the problem for how to solve it and if there is no solution maybe use the solution in the above issue.
Expected behavior
using annotating forward as def forward(self, x: torch.Tensor) -> torch.Tensor: will make the call of out = model(x) return out as a torch.Tensor
The text was updated successfully, but these errors were encountered:
Describe the bug
Currently pytorch type annotates all of its nn.Module class as returning typing.Any which isn't helpful. When you try to define your forward method and type annotate it that doesn't reflect to call of the class as mentioned in this issue (https://discuss.pytorch.org/t/adding-typing-to-call-of-nn-module/118295). Please look into the problem for how to solve it and if there is no solution maybe use the solution in the above issue.
Expected behavior
using annotating forward as
def forward(self, x: torch.Tensor) -> torch.Tensor:
will make the call ofout = model(x)
returnout
as atorch.Tensor
The text was updated successfully, but these errors were encountered: