class_docstr: Parses the inputs and outputs of `Scan` in an easy to manipulate format.
class_docstr_tok: ["Parses","the","inputs","and","outputs","of","`","Scan","`","in","an","easy","to","manipulate","format","."]
docstr: Get the alternate input/output field for a given element of `ScanArgs`.
  
  For example, if `var_info` is in ``ScanArgs.outer_out_sit_sot``, then
  ``get_alt_field(var_info, "inner_out")`` returns the element corresponding
  `var_info` in ``ScanArgs.inner_out_sit_sot``.
  
  Parameters
  ----------
  var_info:
      The element for which we want the alternate
  alt_prefix:
      The string prefix for the alternate field type.  It can be one of
      the following: ``"inner_out"``, ``"inner_in"``, ``"outer_in"``, and
      ``"outer_out"``.
  
  Outputs
  -------
  The alternate variable.
docstr_tok: ["Get","the","alternate","input\/output","field","for","a","given","element","of","`","ScanArgs","`",".","For","example",",","if","`","var_info","`","is","in","``","ScanArgs.outer_out_sit_sot","``",",","then","``","get_alt_field","(","var_info",",","``","inner_out","''",")","``","returns","the","element","corresponding","`","var_info","`","in","``","ScanArgs.inner_out_sit_sot","``",".","Parameters","--","--","--","--","--","var_info",":","The","element","for","which","we","want","the","alternate","alt_prefix",":","The","string","prefix","for","the","alternate","field","type",".","It","can","be","one","of","the","following",":","``","``","inner_out","''","``",",","``","``","inner_in","''","``",",","``","``","outer_in","''","``",",","and","``","``","outer_out","''","``",".","Outputs","--","--","--","-","The","alternate","variable","."]
code: def get_alt_field(
      self, var_info: Union[Variable, FieldInfo], alt_prefix: str
  ) -> Variable:
      """Get the alternate input/output field for a given element of `ScanArgs`.
  
      For example, if `var_info` is in ``ScanArgs.outer_out_sit_sot``, then
      ``get_alt_field(var_info, "inner_out")`` returns the element corresponding
      `var_info` in ``ScanArgs.inner_out_sit_sot``.
  
      Parameters
      ----------
      var_info:
          The element for which we want the alternate
      alt_prefix:
          The string prefix for the alternate field type.  It can be one of
          the following: ``"inner_out"``, ``"inner_in"``, ``"outer_in"``, and
          ``"outer_out"``.
  
      Outputs
      -------
      The alternate variable.
      """
      _var_info: FieldInfo
      if not isinstance(var_info, FieldInfo):
          find_var_info = self.find_among_fields(var_info)
          if find_var_info is None:
              raise ValueError(f"Couldn't find {var_info} among fields")
          _var_info = find_var_info
      else:
          _var_info = var_info
  
      alt_type = _var_info.name[(_var_info.name.index("_", 6) + 1) :]
      alt_var = getattr(self, f"{alt_prefix}_{alt_type}")[
          _var_info.index
      ]
      return type_cast(Variable, alt_var)
  
imports: import copy
  import dataclasses
  import logging
  from collections import OrderedDict, namedtuple
  from collections.abc import Sequence
  from itertools import chain
  from typing import TYPE_CHECKING, Callable, Optional, Union
  from typing import cast
  import numpy
  from pytensor import scalar
  from pytensor import tensor
  from pytensor.compile.profiling import ProfileStats
  from pytensor.configdefaults import config
  from pytensor.graph.basic import Constant, Variable, equal_computations, graph_inputs
  from pytensor.graph.op import get_test_value
  from pytensor.graph.replace import clone_replace
  from pytensor.graph.type import HasDataType
  from pytensor.graph.utils import TestValueError
  from pytensor.tensor.basic import AllocEmpty, cast
  from pytensor.tensor.subtensor import set_subtensor
  from pytensor.tensor.variable import TensorConstant
label_desc: Use image node_id 13 for calling the ScanArgs obj's underlying member method code with example usage: obj.get_alt_field(var_info, alt_prefix) and returns: type_cast