class_docstr: A database of rewrites that should be applied until equilibrium is reached.
  
  Canonicalize, Stabilize, and Specialize are all equilibrium rewriters.
  
  Notes
  -----
  We can use `NodeRewriter` and `GraphRewriter` since `EquilibriumGraphRewriter`
  supports both.
  
  It is probably not a good idea to have both ``ignore_newtrees == False``
  and ``tracks_on_change_inputs == True``.
class_docstr_tok: ["A","database","of","rewrites","that","should","be","applied","until","equilibrium","is","reached",".","Canonicalize",",","Stabilize",",","and","Specialize","are","all","equilibrium","rewriters",".","Notes","--","--","-","We","can","use","`","NodeRewriter","`","and","`","GraphRewriter","`","since","`","EquilibriumGraphRewriter","`","supports","both",".","It","is","probably","not","a","good","idea","to","have","both","``","ignore_newtrees","==","False","``","and","``","tracks_on_change_inputs","==","True","``","."]
docstr: Parameters
  ----------
  ignore_newtrees
      If ``False``, apply rewrites to new nodes introduced during
      rewriting.
  
  tracks_on_change_inputs
      If ``True``, re-apply rewrites on nodes with changed inputs.
code: def __init__(
      self,
      ignore_newtrees: bool = True,
      tracks_on_change_inputs: bool = False,
  ):
      """
  
      Parameters
      ----------
      ignore_newtrees
          If ``False``, apply rewrites to new nodes introduced during
          rewriting.
  
      tracks_on_change_inputs
          If ``True``, re-apply rewrites on nodes with changed inputs.
  
      """
      super().__init__()
      self.ignore_newtrees = ignore_newtrees
      self.tracks_on_change_inputs = tracks_on_change_inputs
      self.__final__: dict[str, bool] = {}
      self.__cleanup__: dict[str, bool] = {}
  
imports: import copy
  import math
  import sys
  from collections.abc import Iterable, Sequence
  from functools import cmp_to_key
  from io import StringIO
  from typing import Optional, Union
  from pytensor.configdefaults import config
  from pytensor.graph.rewriting import basic
  from pytensor.misc.ordered_set import OrderedSet
  from pytensor.utils import DefaultOrderedDict
label_desc: Use image node_id 1 to create a new EquilibriumDB object from inherited base classes: RewriteDatabase with example: obj = EquilibriumDB(ignore_newtrees, tracks_on_change_inputs)