~L iddlZddlmZddlZGddej ZGddej ZeZy)N)Anyc8eZdZdeddffd ZdedefdZxZS)_ClassNamespacenamereturnNc8t|d|z||_yNz torch.classes)super__init__r)selfr __class__s T/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/torch/_classes.pyr z_ClassNamespace.__init__s 4/0 attrctjj|j|}|t d|jd|d|S)NzClass .z not registered!)torch_C _get_custom_class_python_wrapperr RuntimeError)r rproxys r __getattr__z_ClassNamespace.__getattr__ sE99$))TJ = {!D69IJK K r)__name__ __module__ __qualname__strr rr __classcell__r s@rrrs)STrrcZeZdZdZd fd ZdedefdZede fdZ deddfd Z xZ S) _Classesz _classes.pyrNc$t|dyr )r r )r r s rr z_Classes.__init__s )rrc6t|}t||||SN)rsetattr)r r namespaces rrz_Classes.__getattr__s#D) dI&rc6tjjSr#)ropsloaded_libraries)r s rr(z_Classes.loaded_librariessyy)))rpathcBtjj|y)a  Loads a shared library from the given path into the current process. The library being loaded may run global initialization code to register custom classes with the PyTorch JIT runtime. This allows dynamically loading custom classes. For this, you should compile your class and the static registration code into a shared library object, and then call ``torch.classes.load_library('path/to/libcustom.so')`` to load the shared object. After the library is loaded, it is added to the ``torch.classes.loaded_libraries`` attribute, a set that may be inspected for the paths of all libraries loaded using this function. Args: path (str): A path to a shared library to load. N)rr' load_library)r r)s rr+z_Classes.load_library"s$  t$r)rN) rrr__file__r rrrpropertyrr(r+rrs@rr r sNH* *#**%%%rr ) typestypingrtorch._Cr ModuleTyperr classesrrr4s<  e&& !%u!%J *r