code: def _preprocess_inputs(
      inputs: tf.Tensor, output_dtype: tf.DType
  ) -> tf.Tensor:
      """Returns the `Tensor` corresponding to the preprocessed inputs."""
      rank = inputs.shape.rank
      if rank < 4:
          raise ValueError(
              "Input Tensor must have at least 4 dimensions (for "
              "batch size, height, width, and channels), but it only has "
              "{}".format(rank)
          )
  
      flattened_inputs = snt.Flatten(preserve_dims=3)(inputs)
      processed_inputs = tf.image.convert_image_dtype(
          flattened_inputs, dtype=output_dtype
      )
      return processed_inputs
  
file_path: acme/acme/tf/networks/vision.py
imports: from typing import Callable, Optional, Sequence, Union
  import sonnet
  import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: _preprocess_inputs(inputs, output_dtype) and returns: processed_inputs