Skip to content

Disable exported_program.__call__ #1954

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

angelayi
Copy link
Contributor

Summary:
X-link: pytorch/pytorch#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.Modules 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

Copy link

pytorch-bot bot commented Feb 13, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/1954

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit beaf9dc with merge base 98d224e (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 13, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D53075378

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D53075378

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D53075378

angelayi added a commit to angelayi/executorch-1 that referenced this pull request Feb 14, 2024
Summary:

X-link: pytorch/pytorch#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
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D53075378

Summary:

X-link: pytorch/pytorch#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
angelayi added a commit to angelayi/pytorch that referenced this pull request Feb 14, 2024
Summary:
X-link: pytorch/executorch#1954


`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.

Test Plan: CI

Reviewed By: zhxchen17

Differential Revision: D53075378
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D53075378

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in f739212.

@facebook-github-bot
Copy link
Contributor

This pull request has been reverted by 40356ef.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged Reverted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants