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: This function must return a triplet (function, input_variables,
  output_variables) where function is a thunk that operates on the
  returned variables. If inplace is True, the input_variables and
  output_variables lists will be the same as the inputs and outputs
  of the graph provided to the L{Linker}. Else, independent
  variables will be returned.
  
  Examples
  --------
  x, y = Variable(Double, None), Variable(Double, None)
  e = x + y
  fgraph = FunctionGraph([x, y], [e])
  fn, (new_x, new_y), (new_e, ) = MyLinker(fgraph).make_thunk(inplace)
  new_x.data = 1.0
  new_y.data = 2.0
  fn()
  print new_e.data # 3.0
  print e.data # 3.0 iff inplace == True (else unknown)
docstr_tok: ["This","function","must","return","a","triplet","(","function",",","input_variables",",","output_variables",")","where","function","is","a","thunk","that","operates","on","the","returned","variables",".","If","inplace","is","True",",","the","input_variables","and","output_variables","lists","will","be","the","same","as","the","inputs","and","outputs","of","the","graph","provided","to","the","L","{","Linker","}",".","Else",",","independent","variables","will","be","returned",".","Examples","--","--","--","--","x",",","y","=","Variable","(","Double",",","None",")",",","Variable","(","Double",",","None",")","e","=","x","+","y","fgraph","=","FunctionGraph","(","[","x",",","y","]",",","[","e","]",")","fn",",","(","new_x",",","new_y",")",",","(","new_e",",",")","=","MyLinker","(","fgraph",")",".make_thunk","(","inplace",")","new_x.data","=","1.0","new_y.data","=","2.0","fn","(",")","print","new_e.data","#","3.0","print","e.data","#","3.0","iff","inplace","==","True","(","else","unknown",")"]
code: def make_thunk(
      self, **kwargs
  ) -> tuple[Callable, "InputStorageType", "OutputStorageType"]:
      """
      This function must return a triplet (function, input_variables,
      output_variables) where function is a thunk that operates on the
      returned variables. If inplace is True, the input_variables and
      output_variables lists will be the same as the inputs and outputs
      of the graph provided to the L{Linker}. Else, independent
      variables will be returned.
  
      Examples
      --------
      x, y = Variable(Double, None), Variable(Double, None)
      e = x + y
      fgraph = FunctionGraph([x, y], [e])
      fn, (new_x, new_y), (new_e, ) = MyLinker(fgraph).make_thunk(inplace)
      new_x.data = 1.0
      new_y.data = 2.0
      fn()
      print new_e.data # 3.0
      print e.data # 3.0 iff inplace == True (else unknown)
  
      """
  
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 4 for calling the Linker obj's underlying member method code with example usage: obj.make_thunk() without return types