(self, obj, objtype=None)
| 771 | """ |
| 772 | |
| 773 | def __get__(self, obj, objtype=None): |
| 774 | # See docs.python.org/3/howto/descriptor.html#properties |
| 775 | if obj is None: |
| 776 | return self |
| 777 | if self.fget is None: |
| 778 | raise AttributeError("unreadable attribute") |
| 779 | attr = "__cached_" + self.fget.__name__ |
| 780 | cached = getattr(obj, attr, None) |
| 781 | if cached is None: |
| 782 | cached = self.fget(obj) |
| 783 | setattr(obj, attr, cached) |
| 784 | return cached |
| 785 | |
| 786 | |
| 787 | def torch_required(func): |
nothing calls this directly
no outgoing calls
no test coverage detected