-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Closed
Labels
oncall: jitAdd this issue/PR to JIT oncall triage queueAdd this issue/PR to JIT oncall triage queue
Description
When accessing a non-existent attribute on a script module, it gives the error below. It should instead say the attribute does not exist (which is different from it being None).
class A(torch.jit.ScriptModule):
def __init__(self):
super(A, self).__init__()
@torch.jit.script_method
def forward(self, x):
return x + self.whatisgoingon
class B(A):
def __init__(self):
super(B, self).__init__()
@torch.jit.script_method
def bar(self, x):
return x * x
A()
attribute 'whatisgoingon' of type 'NoneType' is not usable in a script method (did you forget to add it __constants__?):
@torch.jit.script_method
def forward(self, x):
return x + self.whatisgoingon
~~~~~~~~~~~~~~~~~~ <--- HERE
Metadata
Metadata
Assignees
Labels
oncall: jitAdd this issue/PR to JIT oncall triage queueAdd this issue/PR to JIT oncall triage queue