class_docstr: Interface for tensorflow models.
docstr: Reshape input into model-expected input.
  
  Parameters
  ----------
  x: np.ndarray
      A given input that is shaped.
  shape: Tuple[int...]
      The shape of the input.
  channel_first: boolean, optional
      Indicates of the image dimensions are channel first, or channel last.
      Inferred from the input shape if None.
  batched: boolean
      Indicates if the first dimension should be expanded or not, if it is just a single instance.
  
  Returns
  -------
  np.ndarray
      A reshaped input.
docstr_tok: ["Reshape","input","into","model-expected","input",".","Parameters","--","--","--","--","--","x",":","np.ndarray","A","given","input","that","is","shaped",".","shape",":","Tuple","[","int","...","]","The","shape","of","the","input",".","channel_first",":","boolean",",","optional","Indicates","of","the","image","dimensions","are","channel","first",",","or","channel","last",".","Inferred","from","the","input","shape","if","None",".","batched",":","boolean","Indicates","if","the","first","dimension","should","be","expanded","or","not",",","if","it","is","just","a","single","instance",".","Returns","--","--","--","-","np.ndarray","A","reshaped","input","."]
code: def shape_input(
      self,
      x: np.ndarray,
      shape: Tuple[int, ...],
      channel_first: Optional[bool] = None,
      batched: bool = False,
  ):
      """
      Reshape input into model-expected input.
  
      Parameters
      ----------
      x: np.ndarray
          A given input that is shaped.
      shape: Tuple[int...]
          The shape of the input.
      channel_first: boolean, optional
          Indicates of the image dimensions are channel first, or channel last.
          Inferred from the input shape if None.
      batched: boolean
          Indicates if the first dimension should be expanded or not, if it is just a single instance.
  
      Returns
      -------
      np.ndarray
          A reshaped input.
      """
      if channel_first is None:
          channel_first = utils.infer_channel_first(x)
  
      # Expand first dimension if this is just a single instance.
      if not batched:
          x = x.reshape(1, *shape)
  
      # Set channel order according to expected input of model.
      if self.channel_first:
          return utils.make_channel_first(x, channel_first)
      return utils.make_channel_last(x, channel_first)
  
imports: from __future__ import annotations
  from typing import Dict, Optional, Tuple, List, Union, Generator
  from keras.layers import Dense
  from keras import activations
  from keras import Model
  from keras.models import clone_model
  import numpy
  import tensorflow
  from warnings import warn
  from cachetools import cachedmethod, LRUCache
  import operator
  from quantus.helpers.model.model_interface import ModelInterface
  from quantus.helpers import utils
label_desc: Use image node_id 8 for calling the TensorFlowModel obj's underlying member method code with example usage: obj.shape_input(x, shape, channel_first, batched) and returns: utils, utils