StreamWrapper¶
- class torchdata.datapipes.utils.StreamWrapper(file_obj)¶
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.