Skip to content

torch.nn.Module.named_parameters has wrong type annotation #48640

@V3RGANz

Description

@V3RGANz

🐛 Bug

named_parameters(prefix: str = '', recurse: bool = True) -> Iterator[Tuple[str, torch.Tensor]] has torch.Tensor in return type, but seems that it always narrower type - nn.Parameter (as in torch.nn.Module.parameters signature)

Environment

pytorch 1.7

cc @albanD @mruberry @ezyang @malfet @rgommers @xuzhao9 @gramster

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: nnRelated to torch.nnmodule: typingRelated to mypy type annotationstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions