class_docstr: Base type for all linkers.
  
  A linker takes a FunctionGraph and turns it into a callable.
  
  Parameters
  ----------
  allow_gc : optional, bool
      Configures if garbage collection is enabled.
  scheduler : callable
      A scheduling function that takes a FunctionGraph and returns
      a list of Apply nodes. Defaults to the .toposort() method of
      the FunctionGraph.
class_docstr_tok: ["Base","type","for","all","linkers",".","A","linker","takes","a","FunctionGraph","and","turns","it","into","a","callable",".","Parameters","--","--","--","--","--","allow_gc",":","optional",",","bool","Configures","if","garbage","collection","is","enabled",".","scheduler",":","callable","A","scheduling","function","that","takes","a","FunctionGraph","and","returns","a","list","of","Apply","nodes",".","Defaults","to","the",".toposort","(",")","method","of","the","FunctionGraph","."]
docstr: Runs the scheduler (if set) or the toposort on the FunctionGraph.
  
  Parameters
  ----------
  fgraph : :py:class:`aerasa.graph.fg.FunctionGraph`
      A graph to compute the schedule for.
  
  Returns
  -------
  nodes : list of :py:class:`pytensor.graph.basic.Apply` nodes
      The result of the scheduling or toposort operation.
docstr_tok: ["Runs","the","scheduler","(","if","set",")","or","the","toposort","on","the","FunctionGraph",".","Parameters","--","--","--","--","--","fgraph",":",":","py",":","class",":","`","aerasa.graph.fg.FunctionGraph","`","A","graph","to","compute","the","schedule","for",".","Returns","--","--","--","-","nodes",":","list","of",":","py",":","class",":","`","pytensor.graph.basic.Apply","`","nodes","The","result","of","the","scheduling","or","toposort","operation","."]
code: def schedule(self, fgraph: FunctionGraph) -> list[Apply]:
      """Runs the scheduler (if set) or the toposort on the FunctionGraph.
  
      Parameters
      ----------
      fgraph : :py:class:`aerasa.graph.fg.FunctionGraph`
          A graph to compute the schedule for.
  
      Returns
      -------
      nodes : list of :py:class:`pytensor.graph.basic.Apply` nodes
          The result of the scheduling or toposort operation.
      """
      if callable(self._scheduler):
          return self._scheduler(fgraph)
      return fgraph.toposort()
  
imports: from abc import ABC, abstractmethod
  from collections.abc import Sequence
  from copy import copy, deepcopy
  from typing import TYPE_CHECKING, Any, Callable, Optional, Union
  from pytensor.configdefaults import config
  from pytensor.graph.basic import Apply, Variable
  from pytensor.graph.fg import FunctionGraph
  from pytensor.graph.type import Type
  from pytensor.link.utils import gc_helper, map_storage, raise_with_op, streamline
  from pytensor.utils import difference
label_desc: Use image node_id 5 for calling the Linker obj's underlying member method code with example usage: obj.schedule(fgraph) and returns: fgraph, self