来自一个或多个二进制文件的固定长度记录的Dataset
。
用法
tf.compat.v1.data.FixedLengthRecordDataset(
filenames, record_bytes, header_bytes=None, footer_bytes=None, buffer_size=None,
compression_type=None, num_parallel_reads=None, name=None
)
参数
-
filenames
一个tf.string
张量或tf.data.Dataset
包含一个或多个文件名。 -
record_bytes
一个tf.int64
标量,表示每条记录中的字节数。 -
header_bytes
(可选。)tf.int64
标量,表示在文件开头要跳过的字节数。 -
footer_bytes
(可选。)tf.int64
标量,表示文件末尾要忽略的字节数。 -
buffer_size
(可选。)tf.int64
标量,表示读取时要缓冲的字节数。 -
compression_type
(可选。)tf.string
标量评估为""
(无压缩)、"ZLIB"
或"GZIP"
之一。 -
num_parallel_reads
(可选。)tf.int64
标量,表示要并行读取的文件数。如果大于1,则以交错的顺序输出并行读取的文件记录。如果您的输入管道存在 I/O 瓶颈,请考虑将此参数设置为大于 1 的值以并行化 I/O。如果None
,文件将被顺序读取。 -
name
(可选。) tf.data 操作的名称。
属性
-
element_spec
此数据集元素的类型规范。dataset = tf.data.Dataset.from_tensor_slices([1, 2, 3]) dataset.element_spec TensorSpec(shape=(), dtype=tf.int32, name=None)
如需更多信息,请阅读本指南。
-
output_classes
返回此数据集元素的每个组件的类。 (已弃用)警告:此函数已弃用。它将在未来的版本中删除。更新说明:使用
tf.compat.v1.data.get_output_classes(dataset)
。 -
output_shapes
返回此数据集元素的每个组件的形状。 (已弃用)警告:此函数已弃用。它将在未来的版本中删除。更新说明:使用
tf.compat.v1.data.get_output_shapes(dataset)
。 -
output_types
返回此数据集元素的每个组件的类型。 (已弃用)警告:此函数已弃用。它将在未来的版本中删除。更新说明:使用
tf.compat.v1.data.get_output_types(dataset)
。
相关用法
- Python tf.compat.v1.data.FixedLengthRecordDataset.skip用法及代码示例
- Python tf.compat.v1.data.FixedLengthRecordDataset.take用法及代码示例
- Python tf.compat.v1.data.FixedLengthRecordDataset.enumerate用法及代码示例
- Python tf.compat.v1.data.FixedLengthRecordDataset.apply用法及代码示例
- Python tf.compat.v1.data.FixedLengthRecordDataset.random用法及代码示例
- Python tf.compat.v1.data.FixedLengthRecordDataset.bucket_by_sequence_length用法及代码示例
- Python tf.compat.v1.data.FixedLengthRecordDataset.cache用法及代码示例
- Python tf.compat.v1.data.FixedLengthRecordDataset.unique用法及代码示例
- Python tf.compat.v1.data.FixedLengthRecordDataset.make_initializable_iterator用法及代码示例
- Python tf.compat.v1.data.FixedLengthRecordDataset.make_one_shot_iterator用法及代码示例
- Python tf.compat.v1.data.FixedLengthRecordDataset.map用法及代码示例
- Python tf.compat.v1.data.FixedLengthRecordDataset.snapshot用法及代码示例
- Python tf.compat.v1.data.FixedLengthRecordDataset.shard用法及代码示例
- Python tf.compat.v1.data.FixedLengthRecordDataset.with_options用法及代码示例
- Python tf.compat.v1.data.FixedLengthRecordDataset.flat_map用法及代码示例
- Python tf.compat.v1.data.FixedLengthRecordDataset.from_generator用法及代码示例
- Python tf.compat.v1.data.FixedLengthRecordDataset.unbatch用法及代码示例
- Python tf.compat.v1.data.FixedLengthRecordDataset.repeat用法及代码示例
- Python tf.compat.v1.data.FixedLengthRecordDataset.group_by_window用法及代码示例
- Python tf.compat.v1.data.FixedLengthRecordDataset.rejection_resample用法及代码示例
注:本文由纯净天空筛选整理自tensorflow.org大神的英文原创作品 tf.compat.v1.data.FixedLengthRecordDataset。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。