Overview

It is a fusion pass based on pattern matching and inherits from FusionBasePass. The execution engine calls the patterns(), meet_requirements(), and replacement() hook methods, rather than the run() method.

Restrictions

  • Do not override run(); if a subclass defines run(), a TypeError will be raised at class definition time.
  • You must implement patterns() or at least one @pattern method, and also implement replacement(); meet_requirements() is optional (default returns True).
  • The @pattern method cannot be used together with patterns().
  • The patterns(self, inputs) form is not supported; for expression patterns, use the @pattern method.