U
    d                     @   sF   d Z ddlmZ ddlm  mZ ddlmZ G dd dZ	e	 Z
dS )zGlobals used internally by the ONNX exporter.

Do not use this module outside of `torch.onnx` and its tests.

Be very judicious when adding any new global variables. Do not create new global
variables unless they are absolutely necessary.
    )OptionalN)
_constantsc                   @   s8   e Zd ZdZdd Zedd ZejedddZdS )	_InternalGlobalszGlobals used internally by ONNX exporter.

    NOTE: Be very judicious when adding any new variables. Do not create new
    global variables unless they are absolutely necessary.
    c                 C   s   t j| _d | _d | _d| _d S )NF)r   Zonnx_default_opset_export_onnx_opset_versionZoperator_export_typeZtraining_modeZonnx_shape_inferenceself r   7/tmp/pip-unpacked-wheel-ua33x9lu/torch/onnx/_globals.py__init__   s    z_InternalGlobals.__init__c                 C   s   | j S )N)r   r   r   r   r	   export_onnx_opset_version   s    z*_InternalGlobals.export_onnx_opset_version)valuec                 C   s4   t jg}|t j ||kr*td| || _d S )Nz Unsupported ONNX opset version: )r   Zonnx_main_opsetextendZonnx_stable_opsets
ValueErrorr   )r   r   Zsupported_versionsr   r   r	   r   #   s
    N)	__name__
__module____qualname____doc__r
   propertyr   setterintr   r   r   r	   r      s   
r   )r   typingr   Ztorch._C._onnxZ_CZ_onnxZ_C_onnxZ
torch.onnxr   r   ZGLOBALSr   r   r   r	   <module>   s
   