來自一個或多個二進製文件的固定長度記錄的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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。