class_docstr: Unconditional start-to-finish program execution in Python.
  
  Garbage collection is possible on intermediate results when the
  `post_thunk_clear` constructor argument is non-``None``.
class_docstr_tok: ["Unconditional","start-to-finish","program","execution","in","Python",".","Garbage","collection","is","possible","on","intermediate","results","when","the","`","post_thunk_clear","`","constructor","argument","is","non-","``","None","``","."]
docstr: Parameters
  ----------
  post_thunk_clear
      A list of storage cells for each thunk that should be cleared after
      each thunk is evaluated.  This is the "garbage collection"
      functionality.
docstr_tok: ["Parameters","--","--","--","--","--","post_thunk_clear","A","list","of","storage","cells","for","each","thunk","that","should","be","cleared","after","each","thunk","is","evaluated",".","This","is","the","``","garbage","collection","''","functionality","."]
code: def __init__(
      self,
      fgraph,
      nodes,
      thunks,
      pre_call_clear,
      storage_map,
      input_storage,
      output_storage,
      update_vars,
      post_thunk_clear: Optional[list["StorageCellType"]] = None,
  ):
      r"""
      Parameters
      ----------
      post_thunk_clear
          A list of storage cells for each thunk that should be cleared after
          each thunk is evaluated.  This is the "garbage collection"
          functionality.
      """
      super().__init__(
          fgraph,
          nodes,
          thunks,
          pre_call_clear,
          storage_map,
          input_storage,
          output_storage,
          update_vars,
      )
  
      if post_thunk_clear is not None:
          if not (len(nodes) == len(thunks) == len(post_thunk_clear)):
              raise ValueError(
                  "`nodes`, `thunks` and `post_thunk_clear` are not the same lengths"
              )
          # Some other part of PyTensor use this information
          self.allow_gc = True
          self.post_thunk_clear = post_thunk_clear
      else:
          self.allow_gc = False
          self.post_thunk_clear = []
  
imports: import platform
  import sys
  import time
  import warnings
  from abc import ABC, abstractmethod
  from collections import defaultdict
  from collections.abc import Sequence
  from itertools import zip_longest
  from typing import TYPE_CHECKING, Any, Optional
  from pytensor.configdefaults import config
  from pytensor.graph.basic import Apply, Constant, Variable
  from pytensor.link.basic import Container, LocalLinker
  from pytensor.link.c.exceptions import MissingGXX
  from pytensor.link.utils import gc_helper, get_destroy_dependencies, map_storage, raise_with_op
label_desc: Use image node_id 1 to create a new Loop object from inherited base classes: UpdatingVM with example: obj = Loop(fgraph, nodes, thunks, pre_call_clear, storage_map, input_storage, output_storage, update_vars, post_thunk_clear)