Class: Torch::Utils::Data::DataPipes::Iter::StreamWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/torch/utils/data/data_pipes/iter/stream_wrapper.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_obj) ⇒ StreamWrapper

Returns a new instance of StreamWrapper.



7
8
9
# File 'lib/torch/utils/data/data_pipes/iter/stream_wrapper.rb', line 7

def initialize(file_obj)
  @file_obj = file_obj
end

Class Method Details

.close_streams(cls) ⇒ Object

TODO improve



20
21
22
23
24
# File 'lib/torch/utils/data/data_pipes/iter/stream_wrapper.rb', line 20

def self.close_streams(cls)
  if cls.is_a?(StreamWrapper)
    cls.close
  end
end

Instance Method Details

#closeObject



15
16
17
# File 'lib/torch/utils/data/data_pipes/iter/stream_wrapper.rb', line 15

def close
  @file_obj.close
end

#getsObject



11
12
13
# File 'lib/torch/utils/data/data_pipes/iter/stream_wrapper.rb', line 11

def gets(...)
  @file_obj.gets(...)
end