
    ^j7                     F   d dl Z d dlZd dlmZ d dlmZ ddlmZmZm	Z	m
Z
mZ ede
j                  dz  fd       Z e       Zer e
j                  e        ej                          5   ej"                  dd	e
        e
j&                          ddd       y# 1 sw Y   yxY w)    N)cache)cast   )cutedsl_utilsdsl_registryopsregistrytriton_utilsreturnc                  H   t        j                  d      } | sy	 ddl}| j                  dd      \  }}|j	                  |      }t        ||      }t        |      st        |  d      t        t        j                  |      S # t        $ r}t        d|  d      |d}~ww xY w)	ag  
    Get a user-supplied graph-ordering function if specified.

    Pass in a `package.submodule.fn` string to the env variable
    `TORCH_PYTHON_NATIVE_USER_GRAPH_ORDER_FN` that implements the
    calling API described in `torch/_native/README.md`. This function
    must be part of an importable path.

    Return either the imported function or `None`
    'TORCH_PYTHON_NATIVE_USER_GRAPH_ORDER_FNNr   .r   z& does not describe a callable functionzCould not resolve z' into an importable & callable function)osgetenv	importlibrsplitimport_modulegetattrcallable	TypeErrorr   r	   UserOrderingFn	Exception
ValueError)env_varr   module_namefn_namemodulefnes          a/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/torch/_native/__init__.pyget_user_ordering_fnr!      s     iiABG  '~~c15W((5VW%|wi'MNOO H++R00  	)PQ
	s   A(B 	B!BB!ignorezNWarning only once for all operators,  other operators may also be overridden\.)messagecategory)r   warnings	functoolsr   typingr    r   r   r   r	   r
   r   r!   user_order_fn!reorder_graphs_from_user_functioncatch_warningsfilterwarningsUserWarning_register_all_overrides     r    <module>r1      s    	    G F !h55< ! !H %&.H..}= X 'Ha
 %H$$&' ' 's   ''BB 