class_docstr: HiFiC Model class.
class_docstr_tok: ["HiFiC","Model","class","."]
docstr: Build input dataset.
docstr_tok: ["Build","input","dataset","."]
code: def build_input(
      self,
      batch_size,
      crop_size,
      images_glob=None,
      tfds_arguments: TFDSArguments = None,
  ):
      """Build input dataset."""
      if not (images_glob or tfds_arguments):
          raise ValueError("Need images_glob or tfds_arguments!")
  
      if self._setup_discriminator:
          # Unroll dataset for GAN training. If we unroll for N steps,
          # we want to fetch (N+1) batches for every step, where 1 batch
          # will be used for G training, and the remaining N batches for D training.
          batch_size *= self._num_steps_disc + 1
  
      if self._setup_discriminator:
          # Split the (N+1) batches into two arguments for build_model.
          def _batch_to_dict(batch):
              num_sub_batches = self._num_steps_disc + 1
              sub_batch_size = batch_size // num_sub_batches
              splits = [
                  sub_batch_size,
                  sub_batch_size * self._num_steps_disc,
              ]
              input_image, input_images_d_steps = tf.split(
                  batch, splits
              )
              return dict(
                  input_image=input_image,
                  input_images_d_steps=input_images_d_steps,
              )
  
      else:
  
          def _batch_to_dict(batch):
              return dict(input_image=batch)
  
      dataset = self._get_dataset(
          batch_size, crop_size, images_glob, tfds_arguments
      )
      return dataset.map(_batch_to_dict)
  
imports: import collections
  import glob
  import itertools
  from compare_gan.gans import loss_lib
  import tensorflow.compat.v1
  import tensorflow_datasets
  from hific import archs
  from hific import helpers
  from hific.helpers import ModelMode
  from hific.helpers import ModelType
  from hific.helpers import TFDSArguments
label_desc: Use image node_id 9 for calling the HiFiC obj's underlying member method code with example usage: obj.build_input(batch_size, crop_size, images_glob, tfds_arguments) and returns: dataset, dict, dict