class_docstr: An abstract class that defines a data source.
class_docstr_tok: ["An","abstract","class","that","defines","a","data","source","."]
docstr: Crates a dataset that loads data in on the fly.
  
  This creates a tf.data.Dataset which lazily loads data as it is read.
  This allows for datasets that do not fit in memory, but this performs
  much worse. Only use if necessary.
  
  Args:
    item_ids: the item IDs to construct the datset with.
    flatten: whether to flatten the image dimensions.
    shuffle: whether to shuffle the dataset.
    row_shuffle_buffer_size: the shuffle buffer size for rows.
    pixel_shuffle_buffer_size: the shuffle buffer size for pixels.
  
  Returns:
    A tf.data.Dataset instance.
code: def _create_lazy_dataset(
      self,
      item_ids,
      flatten=False,
      shuffle=False,
      row_shuffle_buffer_size=1000000,
      pixel_shuffle_buffer_size=1000000,
  ):
      """Crates a dataset that loads data in on the fly.
  
      This creates a tf.data.Dataset which lazily loads data as it is read.
      This allows for datasets that do not fit in memory, but this performs
      much worse. Only use if necessary.
  
      Args:
        item_ids: the item IDs to construct the datset with.
        flatten: whether to flatten the image dimensions.
        shuffle: whether to shuffle the dataset.
        row_shuffle_buffer_size: the shuffle buffer size for rows.
        pixel_shuffle_buffer_size: the shuffle buffer size for pixels.
  
      Returns:
        A tf.data.Dataset instance.
      """
      if shuffle:
          item_ids = self.rng.permutation(item_ids).tolist()
  
      dataset = tf.data.Dataset.from_tensor_slices(item_ids)
      dataset = dataset.map(
          self._get_item_py_function, num_parallel_calls=_TF_AUTOTUNE
      )
      dataset = dataset.map(
          _camera_to_rays_fn, num_parallel_calls=_TF_AUTOTUNE
      )
      if self.has_metadata:
          dataset = dataset.map(_tf_broadcast_metadata_fn)
  
      if flatten:
          # Unbatch images to rows.
          dataset = dataset.unbatch()
          if shuffle:
              dataset = dataset.shuffle(
                  row_shuffle_buffer_size, reshuffle_each_iteration=True
              )
          # Unbatch rows to rays.
          dataset = dataset.unbatch()
          if shuffle:
              dataset = dataset.shuffle(
                  pixel_shuffle_buffer_size,
                  reshuffle_each_iteration=True,
              )
  
      return dataset
  
imports: import abc
  import functools
  import itertools
  from typing import Any, Iterable, Optional, Sequence, Union
  from absl import logging
  from flax import jax_utils
  import jax
  import numpy
  import tensorflow
  from nerfies import camera
  from nerfies import gpath
  from nerfies import image_utils
  from nerfies import tf_camera
  from nerfies import utils
  from tensorflow.python.data.util import nest
label_desc: Use image node_id 27 for calling the DataSource obj's underlying member method code with example usage: obj._create_lazy_dataset(item_ids, flatten, shuffle, row_shuffle_buffer_size, pixel_shuffle_buffer_size) and returns: dataset