def preprocess(self, inputs):
    'Converts a batch of unscaled images to a scale suitable for the model.\n\n    This method normalizes the image using the given `channel_means` and\n    `channels_stds` values at initialization time while optionally flipping\n    the channel order if `bgr_ordering` is set.\n\n    Args:\n      inputs: a [batch, height, width, channels] float32 tensor\n\n    Returns:\n      outputs: a [batch, height, width, channels] float32 tensor\n\n    '
    if self._bgr_ordering:
        (red, green, blue) = tf.unstack(inputs, axis=3)
        inputs = tf.stack([blue, green, red], axis=3)
    channel_means = tf.reshape(tf.constant(self._channel_means), [1, 1, 1, (- 1)])
    channel_stds = tf.reshape(tf.constant(self._channel_stds), [1, 1, 1, (- 1)])
    return ((inputs - channel_means) / channel_stds)
Converts a batch of unscaled images to a scale suitable for the model.

This method normalizes the image using the given `channel_means` and
`channels_stds` values at initialization time while optionally flipping
the channel order if `bgr_ordering` is set.

Args:
  inputs: a [batch, height, width, channels] float32 tensor

Returns:
  outputs: a [batch, height, width, channels] float32 tensor
def preprocess(self, inputs):
    'Converts a batch of unscaled images to a scale suitable for the model.\n\n    This method normalizes the image using the given `channel_means` and\n    `channels_stds` values at initialization time while optionally flipping\n    the channel order if `bgr_ordering` is set.\n\n    Args:\n      inputs: a [batch, height, width, channels] float32 tensor\n\n    Returns:\n      outputs: a [batch, height, width, channels] float32 tensor\n\n    '
    if self._bgr_ordering:
        (red, green, blue) = tf.unstack(inputs, axis=3)
        inputs = tf.stack([blue, green, red], axis=3)
    channel_means = tf.reshape(tf.constant(self._channel_means), [1, 1, 1, (- 1)])
    channel_stds = tf.reshape(tf.constant(self._channel_stds), [1, 1, 1, (- 1)])
    return ((inputs - channel_means) / channel_stds)