parameters: (self, filename, dataset, spec=None, internal=True)
docstring: HDF5IODataset.
docstring_summary: HDF5IODataset.
docstring_tokens: HDF5IODataset .
function: def __init__(self, filename, dataset, spec=None, internal=True):
          """HDF5IODataset."""
          with tf.name_scope("HDF5IODataset"):
              assert internal
  
              components, shapes, dtypes = core_ops.io_hdf5_readable_info(
                  filename, shared=filename, container="HDF5IODataset"
              )
              shape = tf.boolean_mask(shapes, tf.math.equal(components, dataset))[0]
              shape = tf.boolean_mask(shape, tf.math.greater_equal(shape, 0))
  
              if tf.executing_eagerly():
                  dtype = tf.boolean_mask(dtypes, tf.math.equal(components, dataset))[0]
                  dtype = tf.as_dtype(dtype.numpy())
              else:
                  assert spec is not None
                  dtype = spec if isinstance(spec, tf.dtypes.DType) else spec.dtype
  
              self._filename = filename
              self._component = dataset
              self._shape = shape
              self._dtype = dtype
  
              step = 1024
              indices_start = tf.data.Dataset.range(0, shape[0], step)
              indices_stop = indices_start.skip(1).concatenate(
                  tf.data.Dataset.from_tensor_slices([shape[0]])
              )
              dataset = tf.data.Dataset.zip((indices_start, indices_stop))
  
              def f(start, stop):
                  return core_ops.io_hdf5_readable_read(
                      input=self._filename,
                      shared=self._filename,
                      component=self._component,
                      shape=self._shape,
                      start=start,
                      stop=stop,
                      dtype=self._dtype,
                      container="HDF5IODataset",
                  )
  
              dataset = dataset.map(f)
              dataset = dataset.unbatch()
  
              self._dataset = dataset
              super().__init__(
                  self._dataset._variant_tensor
              )
function_tokens: def __init__ ( self , filename , dataset , spec = None , internal = True ) : with tf . name_scope ( "HDF5IODataset" ) : assert internal components , shapes , dtypes = core_ops . io_hdf5_readable_info ( filename , shared = filename , container = "HDF5IODataset" ) shape = tf . boolean_mask ( shapes , tf . math . equal ( components , dataset ) ) [ 0 ] shape = tf . boolean_mask ( shape , tf . math . greater_equal ( shape , 0 ) ) if tf . executing_eagerly ( ) : dtype = tf . boolean_mask ( dtypes , tf . math . equal ( components , dataset ) ) [ 0 ] dtype = tf . as_dtype ( dtype . numpy ( ) ) else : assert spec is not None dtype = spec if isinstance ( spec , tf . dtypes . DType ) else spec . dtype self . _filename = filename self . _component = dataset self . _shape = shape self . _dtype = dtype step = 1024 indices_start = tf . data . Dataset . range ( 0 , shape [ 0 ] , step ) indices_stop = indices_start . skip ( 1 ) . concatenate ( tf . data . Dataset . from_tensor_slices ( [ shape [ 0 ] ] ) ) dataset = tf . data . Dataset . zip ( ( indices_start , indices_stop ) ) def f ( start , stop ) : return core_ops . io_hdf5_readable_read ( input = self . _filename , shared = self . _filename , component = self . _component , shape = self . _shape , start = start , stop = stop , dtype = self . _dtype , container = "HDF5IODataset" , ) dataset = dataset . map ( f ) dataset = dataset . unbatch ( ) self . _dataset = dataset super ( ) . __init__ ( self . _dataset . _variant_tensor )