in optimum/onnxruntime/configuration.py [0:0]
def __post_init__(self):
def deprecate_renamed_attribute(old_name, new_name, mapping_func=None):
if getattr(self, old_name, None) is not None:
if mapping_func is None:
def identity(x):
return x
mapping_func = identity
setattr(self, new_name, mapping_func(getattr(self, old_name)))
warnings.warn(
f"{old_name} will be deprecated soon, use {new_name} instead, {new_name} is set to "
f"{getattr(self, new_name)}.",
FutureWarning,
)
deprecate_renamed_attribute(
"optimize_with_onnxruntime_only",
"enable_transformers_specific_optimizations",
mapping_func=lambda x: not x,
)
deprecate_renamed_attribute("disable_gelu", "disable_bias_gelu_fusion")
deprecate_renamed_attribute("disable_layer_norm", "disable_layer_norm_fusion")
deprecate_renamed_attribute("disable_attention", "disable_attention_fusion")
deprecate_renamed_attribute("disable_skip_layer_norm", "disable_skip_layer_norm_fusion")
deprecate_renamed_attribute("disable_bias_skip_layer_norm", "disable_bias_skip_layer_norm_fusion")
deprecate_renamed_attribute("disable_bias_gelu", "disable_bias_gelu_fusion")
deprecate_renamed_attribute("disable_embed_layer_norm", "disable_embed_layer_norm_fusion")