SIGN IN SIGN UP

Disable exported_program.__call__ (#1954)

Summary:
Pull Request resolved: https://github.com/pytorch/executorch/pull/1954

X-link: https://github.com/pytorch/pytorch/pull/119466

`ExportedProgram` is an artifact produced by torch.export, containing the graph that is exported, along with other attributes about the original program such as the graph signature, state dict, and constants. One slightly confusing thing that users run into is that they treat the `ExportedProgram` as a `torch.nn.Module`, since the object is callable. However, as we do not plan to support all features that `torch.nn.Module`s have, like hooks, we want to create a distinction between it and the `ExportedProgram` by removing the `__call__` method. Instead users can create a proper `torch.nn.Module` through `exported_program.module()` and use that as a callable.

Reviewed By: zhxchen17

Differential Revision: D53075378

fbshipit-source-id: e17671b655b6f410fd5e70971c246f36558324ff
A
Angela Yi committed
f739212d4071d8f73f371363401ac8467a0c80fc
Parent: 8fe00b5
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 2/15/2024, 8:42:09 AM