🐛 Describe the bug
🐛 Describe the bug
when executing the following code:
import torch
class A(torch.nn.Module):
def init(self):
super().init()
@property
def foo(self):
return self.bar # attr error
a = A()
print(a.foo)
I obtain
Traceback (most recent call last):
File "test.py", line 12, in
print(a.foo)
File "xxx/python3.8/site-packages/torch/nn/modules/module.py", line 1729, in getattr
raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'")
AttributeError: 'A' object has no attribute 'foo'
but the expected behavior would be AttributeError: 'A' object has no attribute 'bar'.
Versions
Versions
versions is seemingly irrelevant. Anyhow i use
[conda] torch 2.4.0+cu118 pypi_0 pypi
🐛 Describe the bug
🐛 Describe the bug
when executing the following code:
import torch
class A(torch.nn.Module):
def init(self):
super().init()
a = A()
print(a.foo)
I obtain
Traceback (most recent call last):
File "test.py", line 12, in
print(a.foo)
File "xxx/python3.8/site-packages/torch/nn/modules/module.py", line 1729, in getattr
raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'")
AttributeError: 'A' object has no attribute 'foo'
but the expected behavior would be AttributeError: 'A' object has no attribute 'bar'.
Versions
Versions
versions is seemingly irrelevant. Anyhow i use
[conda] torch 2.4.0+cu118 pypi_0 pypi