Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
onnxscript 0.3.2.dev20250701 documentation
Light Logo Dark Logo
  • Overview
  • Tutorial
    • Rewriter Tutorial
      • Introduction
      • Usage
      • A Simple Example
      • Specifying attributes in the pattern
      • Using the match_condition parameter for pattern-matching
      • OR Patterns
      • Utilizing commute parameter for pattern-matching
    • Optimizer Tutorials
      • Optimizing a Model using the Optimizer
  • API
    • Decorator
    • Opsets and Types
    • Converter
    • Values
    • onnxscript.optimizer
      • optimize
      • inline
      • basic_constant_propagation
      • fold_constants
      • remove_unused_nodes
    • onnxscript.rewriter
      • rewrite
      • RewritePass
    • onnxscript.rewriter.pattern
      • OpsetPatternBuilder
      • MatchResult
      • Constant
      • OrValue
      • PatternMatcher
      • SimplePatternMatcher
      • RewriteRule
      • RewriteRuleSet
      • RewriteRuleClassBase
      • MatchStatus
      • MatchingTracer
    • onnxscript.version_converter
      • convert_version
      • ConvertVersionPass
    • Testing
  • ONNX IR
  • Example Gallery
    • Generating a FunctionProto
    • Generating a ModelProto
    • Generating a LibProto
    • Eager mode evaluation
    • ModelProto Properties
    • Model Local Functions
  • Articles
    • Introducing ONNX Script: authoring ONNX with the ease of Python
Back to top
View this page

PatternMatcher¶

class onnxscript.rewriter.pattern.PatternMatcher(pattern: GraphPattern)[source]¶
abstract match(model: Model, graph_or_function: Graph | Function, node: Node, *, verbose: int = 0, remove_nodes: bool = True, tracer: MatchingTracer | None = None) → MatchResult[source]¶

Match the pattern against the subgraph ending at the given node.

Next
SimplePatternMatcher
Previous
OrValue
Copyright © Microsoft. All rights reserved.
Made with Sphinx and @pradyunsg's Furo
On this page
  • PatternMatcher
    • PatternMatcher
      • PatternMatcher.match()