StreamWrapper#
- class torch.utils.data.datapipes.utils.common.StreamWrapper(file_obj, parent_stream=None, name=None)[source]#
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.