in optimum/onnxruntime/configuration.py [0:0]
def __post_init__(self):
ensure_valid_mode_or_raise(self.is_static, self.mode)
ensure_valid_data_type_or_raise(self.is_static, self.activations_dtype, self.weights_dtype)
# If needed, dynamically set operators_to_quantize default.
if len(self.operators_to_quantize) == 0:
_, _, operators_to_quantize = default_quantization_parameters(
self.is_static, self.format, self.mode, self.operators_to_quantize
)
self.operators_to_quantize = operators_to_quantize
if isinstance(self.format, str):
self.format = QuantFormat[self.format]
if isinstance(self.mode, str):
self.mode = QuantizationMode[self.mode]
if isinstance(self.activations_dtype, str):
self.activations_dtype = QuantType[self.activations_dtype]
if isinstance(self.weights_dtype, str):
self.weights_dtype = QuantType[self.weights_dtype]