Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/langref/relay_pattern.rst
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,8 @@ is required to be run before the callback.
The function ``def callback(self, pre, post, node_map)`` will be invoked when the rewriter matches
``self.pattern``. ``node_map`` is a dictionary mapping from pattern nodes to matched nodes in the graph.

The callback function will be invoked recursively on the returned pattern until the pattern stops changing. As a result, if ``self.pattern`` matches any part of the graph that the callback returned, the rewriter will run in a loop. If you want to avoid multiple rewrites, you can pass a ``rewrite_once=True`` parameter to the constructor.

Pattern Partitioning
********************

Expand Down