Skip to content

torch.jit.script is often broken in Python-3.9 #48674

@malfet

Description

@malfet

Following example:

import torch
def foo(x: torch.Tensor) -> float: 
    return x[-3]
bar=torch.jit.script(foo)
print(bar(torch.rand((10,))))

fails in Python-3.9 with

torch.jit.frontend.NotSupportedError: ellipsis is not supported:
  File "/home/conda/jit.py", line 3
def foo(x: torch.Tensor) -> int:
    return x[-3]
           ~ <--- HERE

cc @gmagogsfm

Metadata

Metadata

Assignees

Labels

oncall: jitAdd this issue/PR to JIT oncall triage queue

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions