Creates a `TFRecordDataset`. Args: filenames: A `tf.string` tensor containing one or more filenames. compression_type: (Optional.) A `tf.string` scalar evaluating to one of `""` (no compression), `"ZLIB"`, or `"GZIP"`. buffer_size: (Optional.) A `tf.int64` scalar repre
(self, filenames, compression_type=None, buffer_size=None)
| 191 | """A `Dataset` comprising records from one or more TFRecord files.""" |
| 192 | |
| 193 | def __init__(self, filenames, compression_type=None, buffer_size=None): |
| 194 | """Creates a `TFRecordDataset`. |
| 195 | |
| 196 | Args: |
| 197 | filenames: A `tf.string` tensor containing one or more filenames. |
| 198 | compression_type: (Optional.) A `tf.string` scalar evaluating to one of |
| 199 | `""` (no compression), `"ZLIB"`, or `"GZIP"`. |
| 200 | buffer_size: (Optional.) A `tf.int64` scalar representing the number of |
| 201 | bytes in the read buffer. 0 means no buffering. |
| 202 | """ |
| 203 | self._filenames = filenames |
| 204 | self._compression_type = convert.optional_param_to_tensor( |
| 205 | "compression_type", |
| 206 | compression_type, |
| 207 | argument_default="", |
| 208 | argument_dtype=dtypes.string) |
| 209 | self._buffer_size = convert.optional_param_to_tensor( |
| 210 | "buffer_size", |
| 211 | buffer_size, |
| 212 | argument_default=_DEFAULT_READER_BUFFER_SIZE_BYTES) |
| 213 | variant_tensor = gen_dataset_ops.tf_record_dataset( |
| 214 | self._filenames, self._compression_type, self._buffer_size) |
| 215 | super(_TFRecordDataset, self).__init__(variant_tensor) |
| 216 | |
| 217 | @property |
| 218 | def element_spec(self): |