Skip to content

A question about torch.nn.Module.__Call__ #42367

@SanftMonster

Description

@SanftMonster

In torch.nn there is an important class named Module, and it implements Call with the code below:
__call__ : Callable[..., Any] = _call_impl
The "Call" returns the return of "_call_impl", how does it works? The "Call" doesn't has an "explicit return" while it actually returns a value, why?
I'm not familiar with Python and pytorch yet, so my question may seems a little dull...I will appreciate it if you don't mind answering my question. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions