---
title: "RewriteMatch"
sidebar_label: "RewriteMatch"
description: "The clika_runtime.graph RewriteMatch class."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

One occurrence a rule (transforms.rewrite) rewrites, read on the graph as the rule's earlier replacements in the same iteration left it; the rule's replacement and condition receive it. Its views keep the graph alive, and the ones a replacement removes are gone afterwards.

## `inputs` (property)

The Values the occurrence reads from outside it: every input of a matched node that no matched node makes, in pattern-node order and then input-port order, each listed once. A constant is one of them. The replacement gets one traced Tensor per entry, in this order.

## `nodes` (property)

The matched Node per pattern node, in add_node order; None for an optional node the occurrence lacks.

## `outputs` (property)

The Values the occurrence makes that a node outside it reads or the graph returns, in the same order, each listed once; the replacement returns one new value per entry.

## `__init__`

```python
__init__(self, /, *args, **kwargs)
```

Initialize self.  See help(type(self)) for accurate signature.
