-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Open
Labels
OSS contribution wantedPR from open source contributors welcome to solve this issue.PR from open source contributors welcome to solve this issue.good first issuemodule: bootcampWe plan to do a full writeup on the issue, and then get someone to do it for onboardingWe plan to do a full writeup on the issue, and then get someone to do it for onboardingoncall: jitAdd this issue/PR to JIT oncall triage queueAdd this issue/PR to JIT oncall triage queue
Description
🐛 Bug
During our hackathon today, I ran into this weird error highlighting.
import torch
from typing import Dict
@torch.jit.script
def missing_index(x: Dict[str, int]) -> int:
return x['dne']
missing_index({'item': 20, 'other_item': 120})
This code outputs:
9
10
---> 11 missing_index({'item': 20, 'other_item': 120})
RuntimeError: The following operation failed in the TorchScript interpreter.
Traceback of TorchScript (most recent call last):
File "<ipython-input-6-f7e8ae85d5ad>", line 8, in missing_index
@torch.jit.script
def missing_index(x: Dict[str, int]) -> int:
return x['dne']
~~~~ <--- HERE
RuntimeError: KeyError: dne
I feel like the highlighted range should be either shorter or long enough to highlight the entire statement.
cc @gmagogsfm
Metadata
Metadata
Assignees
Labels
OSS contribution wantedPR from open source contributors welcome to solve this issue.PR from open source contributors welcome to solve this issue.good first issuemodule: bootcampWe plan to do a full writeup on the issue, and then get someone to do it for onboardingWe plan to do a full writeup on the issue, and then get someone to do it for onboardingoncall: jitAdd this issue/PR to JIT oncall triage queueAdd this issue/PR to JIT oncall triage queue