Example #1
0
    def from_hdf5(cls, filename, **kwargs):
        """Creates an `IOTensor` from an hdf5 file.

    Args:
      filename: A string, the filename of an hdf5 file.
      name: A name prefix for the IOTensor (optional).

    Returns:
      A `IOTensor`.

    """
        with tf.name_scope(kwargs.get("name", "IOFromHDF5")):
            return hdf5_io_tensor_ops.HDF5IOTensor(filename, internal=True)
Example #2
0
File: io_tensor.py Project: tmct/io
    def from_hdf5(cls, filename, spec=None, **kwargs):
        """Creates an `IOTensor` from an hdf5 file.

        Args:
          filename: A string, the filename of an hdf5 file.
          spec: A dict of `dataset:tf.TensorSpec` or `dataset:dtype`
            pairs that specify the dataset selected and the tf.TensorSpec
            or dtype of the dataset. In eager mode the spec is probed
            automatically. In graph mode spec has to be specified.
          name: A name prefix for the IOTensor (optional).

        Returns:
          A `IOTensor`.

        """
        with tf.name_scope(kwargs.get("name", "IOFromHDF5")):
            return hdf5_io_tensor_ops.HDF5IOTensor(filename,
                                                   spec=spec,
                                                   internal=True)