class_docstr: Apply `np.swapaxes` to fields.
  
  Parameters
  ----------
  input_fields
      Field to apply to
  axes
      Axes to use
class_docstr_tok: ["Apply","`","np.swapaxes","`","to","fields",".","Parameters","--","--","--","--","--","input_fields","Field","to","apply","to","axes","Axes","to","use"]
code: def swap(self, v):
      if isinstance(v, np.ndarray):
          return np.swapaxes(v, self.axis1, self.axis2)
      if isinstance(v, list):
          return [self.swap(x) for x in v]
      else:
          raise ValueError(
              f"Unexpected field type {type(v).__name__}, expected "
              "np.ndarray or list[np.ndarray]"
          )
  
imports: from typing import Callable, Iterator, List, Optional, Tuple, Type
  import numpy
  from toolz import valmap
  from gluonts.core.component import validated, tensor_to_numpy
  from gluonts.dataset.common import DataEntry
  from gluonts.exceptions import assert_data_error
  from ._base import FlatMapTransformation, MapTransformation, SimpleTransformation
label_desc: Use image node_id 3 for calling the SwapAxes obj's underlying member method code with example usage: obj.swap(v) and returns: np, unknown