o
    Zhs                     @   s8   d dl mZ dedefddZdedee fddZd	S )
    )Optional	case_namereturnc                 C   sX   ddl m} ddlm} | }| |v r!| dd}d|  d| S |d	| d
 |  dS )N   )all_examplesr   )log_export_usage_-zSee zo in exportdb for unsupported case.                 https://pytorch.org/docs/main/generated/exportdb/index.html#zexport.error.casenotregistered)eventmessagez is unsupported.)Zexamplesr   Ztorch._utils_internalr   replace)r   r   r   ZALL_EXAMPLESZurl_case_name r   G/var/www/auris/lib/python3.10/site-packages/torch/_export/db/logging.pyexportdb_error_message   s   
r   ec                 C   s`   ddl m}m}m} d}d}|||||di}t| |v r.|t|  }|du r(|S t| |dS dS )ze
    Returns a string case name if the export error e is classified.
    Returns None otherwise.
    r   )TorchRuntimeErrorUnsupported	UserErrorZalways_classifiedr   N)Ztorch._dynamo.excr   r   r   typegetattr)r   r   r   r   ZALWAYS_CLASSIFIEDZDEFAULT_CLASS_SIGILZ_ALLOW_LISTZ	attr_namer   r   r   get_class_if_classified_error   s   r   N)typingr   strr   	Exceptionr   r   r   r   r   <module>   s    