
    Vh                     Z    d dl Z ddlmZmZmZmZmZ ddlmZm	Z	m
Z
mZ ddgZdefdZd	 Zy)
    N   )_get_binary_op_configs_get_conv_configs_get_linear_configs_get_share_qparams_op_configs_get_tensor_info_op_configs)BackendConfigBackendPatternConfigDTypeConfigObservationTypeget_tensorrt_backend_config get_tensorrt_backend_config_dictreturnc                  |   t        t        j                  t        j                  t        j                  t        j                        } t        t        j                  t        j                        }t	        t        j
                        j                  t        j                        j                  |       j                  dddd      }t	        t        j                        j                  t        j                        j                  |      }| g}| g}| g}|g}|g}t        d      j                  t        |            j!                  |      j!                  |      j                  t#        |            j                  t%        |            j                  t'        |            j                  t)        |            S )z
    Return the `BackendConfig` for the TensorRT backend.
    NOTE: Current api will change in the future, it's just to unblock experimentation for
    new backends, please don't use it right now.
    TODO: add a README when it's more stable
    )input_dtypeoutput_dtypeweight_dtype
bias_dtype)r   r   r   r      )biasinputweighttensorrt)r   torchqint8floatr
   addmmset_observation_typer   &OUTPUT_USE_DIFFERENT_OBSERVER_AS_INPUTadd_dtype_config_set_input_type_to_indexcat OUTPUT_SHARE_OBSERVER_WITH_INPUTr	   set_backend_pattern_configsr   set_backend_pattern_configr   r   r   r   )	weighted_op_qint8_dtype_config"non_weighted_op_qint8_dtype_configaddmm_config
cat_configconv_dtype_configslinear_dtype_configsbinary_op_dtype_configsshare_qparams_op_dtype_configstensor_info_op_dtype_configss	            ]/home/dcms/DCMS/lib/python3.12/site-packages/torch/ao/quantization/backend_config/tensorrt.pyr   r      s    &1KK[[[[;;	&" *5KK[[*& 	U[[)		oTT	U		8	9	!	!

	  	UYY'		oNN	O		<	=  	' 	' 	' 	+&" 	+$  	j!	$	$%67I%J	K	#	#L	1	#	#J	/	$	$%89M%N	O	$	$%;<S%T	U	$	$)*HI

 
%	$'(DE

    c                  2    t               j                         S )zQ
    Return the `BackendConfig` for the TensorRT backend in dictionary form.
    )r   to_dict r0   r/   r   r   ^   s     '(0022r0   )r   _common_operator_config_utilsr   r   r   r   r   backend_configr	   r
   r   r   __all__r   r   r3   r0   r/   <module>r7      s?       "&B] BJ3r0   