Class: Tensorflow::Data::FixedLengthRecordDataset

Inherits:
Dataset
  • Object
show all
Defined in:
lib/tensorflow/data/fixed_length_record_dataset.rb

Constant Summary

Constants inherited from Dataset

Dataset::DEFAULT_READER_BUFFER_SIZE_BYTES

Instance Attribute Summary

Attributes inherited from Dataset

#output_shapes, #output_types, #variant_tensor

Instance Method Summary collapse

Methods inherited from Dataset

#batch, #data, #each, from_tensor_slices, from_tensors, #make_initializable_iterator, #make_one_shot_iterator, #map_func, #repeat, #shuffle, #to_ptr, to_tensor_array, #with_options

Constructor Details

#initialize(filenames, record_bytes, header_bytes: 0, footer_bytes: 0, buffer_size: DEFAULT_READER_BUFFER_SIZE_BYTES, compression_type: '', num_parallel_reads: 0) ⇒ FixedLengthRecordDataset

Returns a new instance of FixedLengthRecordDataset.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/tensorflow/data/fixed_length_record_dataset.rb', line 4

def initialize(filenames, record_bytes, header_bytes: 0, footer_bytes: 0,
               buffer_size: DEFAULT_READER_BUFFER_SIZE_BYTES, compression_type: '', num_parallel_reads: 0)
  @output_types = [:string]
  @output_shapes = [[]]

  record_bytes_tensor = Tensor.new(record_bytes, dtype: :int64)
  header_bytes_tensor = Tensor.new(header_bytes, dtype: :int64)
  footer_bytes_tensor = Tensor.new(footer_bytes, dtype: :int64)
  buffer_size_tensor = Tensor.new(buffer_size, dtype: :int64)

  variant_tensor = RawOps.fixed_length_record_dataset_v2(filenames,
                                                         header_bytes_tensor,
                                                         record_bytes_tensor,
                                                         footer_bytes_tensor,
                                                         buffer_size_tensor,
                                                         compression_type)

  super(variant_tensor)
end