
    Pg                     v    d dl Z d dlZ G d de j                        Z G d de j                        Z e       Zy)    Nc                   $     e Zd Z fdZd Z xZS )_ClassNamespacec                 8    t         |   d|z          || _        y Nztorch.classes)super__init__name)selfr	   	__class__s     U/var/www/html/suriana-translation/venv/lib/python3.12/site-packages/torch/_classes.pyr   z_ClassNamespace.__init__   s    4/0	    c                     t         j                  j                  | j                  |      }|t	        d| j                   d| d      |S )NzClass .z not registered!)torch_C _get_custom_class_python_wrapperr	   RuntimeError)r
   attrproxys      r   __getattr__z_ClassNamespace.__getattr__   sE    99$))TJ=		{!D69IJKKr   )__name__
__module____qualname__r   r   __classcell__r   s   @r   r   r      s    r   r   c                   @     e Zd ZdZd fdZd Zed        Zd Z xZ	S )_Classesz_classes.pyc                 $    t         |   d       y r   )r   r   )r
   r   s    r   r   z_Classes.__init__   s    )r   c                 6    t        |      }t        | ||       |S N)r   setattr)r
   r	   	namespaces      r   r   z_Classes.__getattr__   s    #D)	dI&r   c                 6    t         j                  j                  S r    )r   opsloaded_libraries)r
   s    r   r%   z_Classes.loaded_libraries   s    yy)))r   c                 B    t         j                  j                  |       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)r   r$   load_library)r
   paths     r   r'   z_Classes.load_library"   s    $ 			t$r   )returnN)
r   r   r   __file__r   r   propertyr%   r'   r   r   s   @r   r   r      s+    H*
 * *%r   r   )typestorch._Cr   
ModuleTyper   r   classes r   r   <module>r1      s9     	e&& 	!%u !%J *r   