Dataset
包含來自一個或多個文本文件的行。
用法
tf.compat.v1.data.TextLineDataset(
filenames, compression_type=None, buffer_size=None, num_parallel_reads=None,
name=None
)
參數
-
filenames
一個tf.data.Dataset
,其元素是tf.string
標量、tf.string
張量或可以轉換為tf.string
張量的值(例如 Python 字符串列表)。 -
compression_type
(可選。)tf.string
標量評估為""
(無壓縮)、"ZLIB"
或"GZIP"
之一。 -
buffer_size
(可選。)tf.int64
標量,表示要緩衝的字節數。值 0 會導致根據壓縮類型選擇默認緩衝值。 -
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.TextLineDataset.from_tensors用法及代碼示例
- Python tf.compat.v1.data.TextLineDataset.filter用法及代碼示例
- Python tf.compat.v1.data.TextLineDataset.take_while用法及代碼示例
- Python tf.compat.v1.data.TextLineDataset.skip用法及代碼示例
- Python tf.compat.v1.data.TextLineDataset.bucket_by_sequence_length用法及代碼示例
- Python tf.compat.v1.data.TextLineDataset.sample_from_datasets用法及代碼示例
- Python tf.compat.v1.data.TextLineDataset.cardinality用法及代碼示例
- Python tf.compat.v1.data.TextLineDataset.as_numpy_iterator用法及代碼示例
- Python tf.compat.v1.data.TextLineDataset.zip用法及代碼示例
- Python tf.compat.v1.data.TextLineDataset.unbatch用法及代碼示例
- Python tf.compat.v1.data.TextLineDataset.with_options用法及代碼示例
- Python tf.compat.v1.data.TextLineDataset.random用法及代碼示例
- Python tf.compat.v1.data.TextLineDataset.reduce用法及代碼示例
- Python tf.compat.v1.data.TextLineDataset.from_generator用法及代碼示例
- Python tf.compat.v1.data.TextLineDataset.snapshot用法及代碼示例
- Python tf.compat.v1.data.TextLineDataset.cache用法及代碼示例
- Python tf.compat.v1.data.TextLineDataset.range用法及代碼示例
- Python tf.compat.v1.data.TextLineDataset.rejection_resample用法及代碼示例
- Python tf.compat.v1.data.TextLineDataset.unique用法及代碼示例
- Python tf.compat.v1.data.TextLineDataset.shard用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.compat.v1.data.TextLineDataset。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。