MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / _buffer_reader

Class _buffer_reader

python/paddle/framework/io_utils.py:48–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46
47
48class _buffer_reader(_open_buffer):
49 def __init__(self, buffer):
50 super().__init__(buffer)
51 self.initial_tell = self.buffer.tell()
52
53 def __exit__(self, *args):
54 # `args[0]` is type of exception. When the `read` is abnormal, the file pointer returns to the initial position.
55 if args[0] is not None:
56 self.buffer.seek(self.initial_tell)
57
58
59class _buffer_writer(_open_buffer):

Callers 1

_open_file_bufferFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected