code: def get_synth_input_fn(
      height,
      width,
      num_channels,
      num_classes,
      dtype=tf.float32,
      drop_remainder=True,
  ):
      """Returns an input function that returns a dataset with random data.
  
      This input_fn returns a data set that iterates over a set of random data and
      bypasses all preprocessing, e.g. jpeg decode and copy. The host to device
      copy is still included. This used to find the upper throughput bound when
      tuning the full input pipeline.
  
      Args:
        height: Integer height that will be used to create a fake image tensor.
        width: Integer width that will be used to create a fake image tensor.
        num_channels: Integer depth that will be used to create a fake image tensor.
        num_classes: Number of classes that should be represented in the fake labels
          tensor
        dtype: Data type for features/images.
        drop_remainder: A boolean indicates whether to drop the remainder of the
          batches. If True, the batch dimension will be static.
  
      Returns:
        An input_fn that can be used in place of a real one to return a dataset
        that can be used for iteration.
      """
  
      # pylint: disable=unused-argument
      def input_fn(is_training, data_dir, batch_size, *args, **kwargs):
          """Returns dataset filled with random data."""
          inputs, labels = get_synth_data(
              height=height,
              width=width,
              num_channels=num_channels,
              num_classes=num_classes,
              dtype=dtype,
          )
          # Cast to float32 for Keras model.
          labels = tf.cast(labels, dtype=tf.float32)
          data = tf.data.Dataset.from_tensors((inputs, labels)).repeat()
  
          # `drop_remainder` will make dataset produce outputs with known shapes.
          data = data.batch(batch_size, drop_remainder=drop_remainder)
          data = data.prefetch(
              buffer_size=tf.data.experimental.AUTOTUNE
          )
          return data
  
      return input_fn
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  from absl import flags
  import numpy
  import tensorflow
  from tensorflow.python.keras.optimizer_v2 import gradient_descent
  from utils.flags import core
  from utils.misc import keras_utils
label_desc: Use image node_id 7 for calling a global function with example usage: get_synth_input_fn(height, width, num_channels, num_classes, dtype, drop_remainder) and returns: input_fn, data