Skip to content

Support having a different forward method when we are not in scripting mode#38158

Closed
yf225 wants to merge 1 commit intomasterfrom
ts_dper3_low_level_module
Closed

Support having a different forward method when we are not in scripting mode#38158
yf225 wants to merge 1 commit intomasterfrom
ts_dper3_low_level_module

Conversation

@yf225
Copy link
Copy Markdown
Contributor

@yf225 yf225 commented May 8, 2020

TorchScript currently doesn’t support *args, **kwargs in method signature, which is extensively used in DPER3 low-level modules’ forward method. In order to make DPER3 low-level modules scriptable, I was thinking about a solution of having a forward method only for TorchScript, and replace the forward method when we are not in scripting mode.

This solution works today, and I would like to add a test to make sure it will always work in the future.

@yf225 yf225 added oncall: jit Add this issue/PR to JIT oncall triage queue triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels May 8, 2020
@yf225 yf225 requested review from eellison and suo May 8, 2020 22:45
Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yf225 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@yf225 merged this pull request in 38d141e.

@facebook-github-bot facebook-github-bot deleted the ts_dper3_low_level_module branch July 13, 2020 17:58
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
…g mode (pytorch#38158)

Summary:
TorchScript currently doesn’t support `*args, **kwargs` in method signature, which is extensively used in DPER3 low-level modules’ forward method. In order to make DPER3 low-level modules scriptable, I was thinking about a solution of having a forward method *only* for TorchScript, and replace the forward method when we are not in scripting mode.

This solution works today, and I would like to add a test to make sure it will always work in the future.
Pull Request resolved: pytorch#38158

Differential Revision: D21485657

Pulled By: yf225

fbshipit-source-id: df7368e8a5265418be7c305e6666ffd76e595466
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged oncall: jit Add this issue/PR to JIT oncall triage queue triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants