StreamWrapper¶
- class torchdata.datapipes.utils.StreamWrapper(file_obj, parent_stream=None, name=None)¶
StreamWrapper is introduced to wrap file handler generated by DataPipe operation like FileOpener. StreamWrapper would guarantee the wrapped file handler is closed when it’s out of scope.