blob: ab6f1b722b8d45da0fa0ec5052b840c4cd4783d4 [file] [log] [blame]
import types
import torch._C
class _Classes(types.ModuleType):
def __init__(self):
super(_Classes, self).__init__('torch.classes')
def __getattr__(self, attr):
proxy = torch._C._get_custom_class_python_wrapper(attr)
if proxy is None:
raise RuntimeError('Class {} not registered!'.format(attr))
return proxy
# The classes "namespace"
classes = _Classes()