IOTensor
Inherits From: IOTensor
tfio.experimental.IOTensor(
    spec, internal=False
)
| Attributes | 
|---|
| spec | The TensorSpecof values in this tensor. | 
Methods
from_arrow
View source
@classmethod
from_arrow(
    table, spec=None, **kwargs
)
Creates an IOTensor from a pyarrow.Table.
| Args | 
|---|
| table | An instance of a pyarrow.Table. | 
| spec | A dict of dataset:tf.TensorSpecordataset:dtypepairs that specify the dataset selected and the tf.TensorSpec
or dtype of the dataset. In eager mode the spec is probed
automatically. In graph modespecis required and columns
in thepyarrow.Tablecan be keyed by column name or index. | 
| name | A name prefix for the IOTensor (optional). | 
from_audio
View source
@classmethod
from_audio(
    filename, **kwargs
)
Creates an IOTensor from an audio file.
The following audio file formats are supported:
| Args | 
|---|
| filename | A string, the filename of an audio file. | 
| name | A name prefix for the IOTensor (optional). | 
from_avro
View source
@classmethod
from_avro(
    filename, schema, **kwargs
)
Creates an IOTensor from an avro file.
| Args | 
|---|
| filename | A string, the filename of an avro file. | 
| schema | A string, the schema of an avro file. | 
| name | A name prefix for the IOTensor (optional). | 
from_csv
View source
@classmethod
from_csv(
    filename, **kwargs
)
Creates an IOTensor from an csv file.
| Args | 
|---|
| filename | A string, the filename of an csv file. | 
| name | A name prefix for the IOTensor (optional). | 
from_exr
View source
@classmethod
from_exr(
    filename, **kwargs
)
Creates an IOTensor from a OpenEXR file.
| Args | 
|---|
| filename | A string, the filename of a OpenEXR file. | 
| name | A name prefix for the IOTensor (optional). | 
from_feather
View source
@classmethod
from_feather(
    filename, **kwargs
)
Creates an IOTensor from an feather file.
| Args | 
|---|
| filename | A string, the filename of an feather file. | 
| name | A name prefix for the IOTensor (optional). | 
from_ffmpeg
View source
@classmethod
from_ffmpeg(
    filename, **kwargs
)
Creates an IOTensor from a audio/video file.
| Args | 
|---|
| filename | A string, the filename of a audio/video file. | 
| name | A name prefix for the IOTensor (optional). | 
from_hdf5
View source
@classmethod
from_hdf5(
    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.TensorSpecordataset:dtypepairs 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). | 
from_json
View source
@classmethod
from_json(
    filename, **kwargs
)
Creates an IOTensor from an json file.
| Args | 
|---|
| filename | A string, the filename of an json file. | 
| name | A name prefix for the IOTensor (optional). | 
from_kafka
View source
@classmethod
from_kafka(
    topic, partition=0, servers=None, configuration=None, **kwargs
)
Creates an IOTensor from a Kafka stream.
| Args | 
|---|
| topic | A tf.stringtensor containing topic subscription. | 
| partition | A tf.int64tensor containing the partition, by default 0. | 
| servers | An optional list of bootstrap servers, by default localhost:9092. | 
| configuration | An optional tf.stringtensor containing
configurations in [Key=Value] format. There are three
types of configurations:
Global configuration: please refer to 'Global configuration properties'
  in librdkafka doc. Examples include
  ["enable.auto.commit=false", "heartbeat.interval.ms=2000"]
Topic configuration: please refer to 'Topic configuration properties'
  in librdkafka doc. Note all topic configurations should be
  prefixed withconfiguration.topic.. Examples include
  ["conf.topic.auto.offset.reset=earliest"] | 
| name | A name prefix for the IOTensor (optional). | 
from_lmdb
View source
@classmethod
from_lmdb(
    filename, **kwargs
)
Creates an IOTensor from a LMDB key/value store.
| Args | 
|---|
| filename | A string, the filename of a LMDB file. | 
| name | A name prefix for the IOTensor (optional). | 
from_parquet
View source
@classmethod
from_parquet(
    filename, **kwargs
)
Creates an IOTensor from a parquet file.
| Args | 
|---|
| filename | A string, the filename of a parquet file. | 
| name | A name prefix for the IOTensor (optional). | 
from_tensor
View source
@classmethod
from_tensor(
    tensor, **kwargs
)
Converts a tf.Tensor into a IOTensor.
Examples:
| Args | 
|---|
| tensor | The Tensorto convert. | 
| Raises | 
|---|
| ValueError | If tensor is not a Tensor. | 
from_tiff
View source
@classmethod
from_tiff(
    filename, **kwargs
)
Creates an IOTensor from a tiff file.
Note tiff file may consists of multiple images with different shapes.
| Args | 
|---|
| filename | A string, the filename of a tiff file. | 
| name | A name prefix for the IOTensor (optional). | 
graph
View source
@classmethod
graph(
    dtype
)
Obtain a GraphIOTensor to be used in graph mode.
| Args | 
|---|
| dtype | Data type of the GraphIOTensor. | 
| Returns | 
|---|
| A class of GraphIOTensor. |