Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jit] Calling torch.jit.script on @staticmethods which in turn call other @staticmethods results in a TypeError #32365

Open
SamPruden opened this issue Jan 17, 2020 · 1 comment
Labels
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

Comments

@SamPruden
Copy link

SamPruden commented Jan 17, 2020

馃悰 Bug

Calling torch.jit.script on @staticmethods that in turn call other @staticmethods results in an internal error.

To Reproduce

class Foo:
  @staticmethod
  def bar():
    return Foo.whiz()

  @staticmethod
  def whiz():
    return 1

torch.jit.script(Foo.bar)

Results in TypeError: <module '__main__'> is a built-in class.

Environment

Google Colab with a fresh GPU runtime on which !pip install -q torch==1.4.0 has been run.

This is a spin off of #32300 at @driazati's request.

cc @suo

@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Jan 17, 2020
@suo suo added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Jan 18, 2020
@suo
Copy link
Member

suo commented Jan 18, 2020

Assigning to @driazati

@driazati driazati removed their assignment Nov 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

No branches or pull requests

4 participants