Class: Torch::Utils::Data::DataPipes::Iter::StreamWrapper
- Inherits:
-
Object
- Object
- Torch::Utils::Data::DataPipes::Iter::StreamWrapper
- Defined in:
- lib/torch/utils/data/data_pipes/iter/stream_wrapper.rb
Class Method Summary collapse
-
.close_streams(cls) ⇒ Object
TODO improve.
Instance Method Summary collapse
- #close ⇒ Object
- #gets ⇒ Object
-
#initialize(file_obj) ⇒ StreamWrapper
constructor
A new instance of StreamWrapper.
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
#close ⇒ Object
15 16 17 |
# File 'lib/torch/utils/data/data_pipes/iter/stream_wrapper.rb', line 15 def close @file_obj.close end |
#gets ⇒ Object
11 12 13 |
# File 'lib/torch/utils/data/data_pipes/iter/stream_wrapper.rb', line 11 def gets(...) @file_obj.gets(...) end |