parameters: (x, data_format=None)
return_statement: return x
docstring: Preprocesses a tensor encoding a batch of images.
  
    Arguments:
        x: input Numpy tensor, 4D.
        data_format: data format of the image tensor.
  
    Returns:
        Preprocessed tensor.
docstring_summary: Preprocesses a tensor encoding a batch of images.
docstring_tokens: Preprocesses a tensor encoding a batch of images .
function: def preprocess_input(x, data_format=None):
    """Preprocesses a tensor encoding a batch of images.
  
    Arguments:
        x: input Numpy tensor, 4D.
        data_format: data format of the image tensor.
  
    Returns:
        Preprocessed tensor.
    """
    if data_format is None:
      data_format = K.image_data_format()
    assert data_format in {'channels_last', 'channels_first'}
  
    if data_format == 'channels_first':
      # 'RGB'->'BGR'
      x = x[:, ::-1, :, :]
      # Zero-center by mean pixel
      x[:, 0, :, :] -= 103.939
      x[:, 1, :, :] -= 116.779
      x[:, 2, :, :] -= 123.68
    else:
      # 'RGB'->'BGR'
      x = x[:, :, :, ::-1]
      # Zero-center by mean pixel
      x[:, :, :, 0] -= 103.939
      x[:, :, :, 1] -= 116.779
      x[:, :, :, 2] -= 123.68
    return x
function_tokens: def preprocess_input ( x , data_format = None ) : if data_format is None : data_format = K . image_data_format ( ) assert data_format in { 'channels_last' , 'channels_first' } if data_format == 'channels_first' : # 'RGB'->'BGR' x = x [ : , : : - 1 , : , : ] # Zero-center by mean pixel x [ : , 0 , : , : ] -= 103.939 x [ : , 1 , : , : ] -= 116.779 x [ : , 2 , : , : ] -= 123.68 else : # 'RGB'->'BGR' x = x [ : , : , : , : : - 1 ] # Zero-center by mean pixel x [ : , : , : , 0 ] -= 103.939 x [ : , : , : , 1 ] -= 116.779 x [ : , : , : , 2 ] -= 123.68 return x