Source code for experimental_experiment.xoptim.patterns_ort
fromtypingimportList
[docs]defget_onnxruntime_patterns(verbose:int=0,)->List["PatternOptimization"]:# noqa: F821""" Returns a default list of optimization patterns for onnxruntime. It is equal to the following list. .. runpython:: :showcode: import pprint from experimental_experiment.xoptim.patterns_ort import get_onnxruntime_patterns pprint.pprint(get_onnxruntime_patterns()) """from.activationimport(BiasGeluPattern,FastGeluPattern,GeluOrtPattern,GeluErfPattern,)from.activation_gradimportSoftmaxGradPatternfrom.fused_matmulimport(FusedMatMulDivPattern,FusedMatMulPattern,FusedMatMulx2Pattern,FusedMatMulTransposePattern,)# from .gather_grad import GatherGradPatternfrom.simplified_layer_normalizationimportSimplifiedLayerNormalizationPatternreturn[BiasGeluPattern(verbose=verbose),GeluOrtPattern(verbose=verbose),GeluErfPattern(verbose=verbose),FastGeluPattern(verbose=verbose),FusedMatMulPattern(verbose=verbose),FusedMatMulx2Pattern(verbose=verbose),FusedMatMulDivPattern(verbose=verbose),FusedMatMulTransposePattern(verbose=verbose),# GatherGradPattern(verbose=verbose),SimplifiedLayerNormalizationPattern(verbose=verbose),SoftmaxGradPattern(verbose=verbose),]