experimental_experiment.xoptim.patterns_api

class experimental_experiment.xoptim.patterns_api.OnnxEasyPatternOptimization(match_model: ModelProto | FunctionProto, apply_model: ModelProto | FunctionProto, verbose: int = 0)[source]

Implementations pattern matching with onnx models.

Parameters:
  • match_model – model expressing the pattern to match

  • apply_model – model expression the replacement pattern

experimental_experiment.xoptim.patterns_api.make_pattern_from_onnx(name: str, match_model: ModelProto | FunctionProto, apply_model: ModelProto | FunctionProto, verbose: int = 0)[source]

Dynamically create a new class inheriting from EasyPatternOptimization.

Parameters:
  • name – class name

  • match_model – model expressing the pattern to match

  • apply_model – model expression the replacement pattern

  • verbose – verbosity

Returns:

instance of a new class