MCPcopy Create free account
hub / github.com/zai-org/CodeGeeX / __init__

Method __init__

codegeex/megatron/memory.py:137–143  ·  view source on GitHub ↗
(self, name, num_buffers, numel, dtype, track_usage)

Source from the content-addressed store, hash-verified

135 """A ring of memory buffers."""
136
137 def __init__(self, name, num_buffers, numel, dtype, track_usage):
138 self.num_buffers = num_buffers
139 self.buffers = [
140 allocate_mem_buff(name + " {}".format(i), numel, dtype, track_usage)
141 for i in range(num_buffers)
142 ]
143 self._index = -1
144
145 def get_next_buffer(self):
146 self._index += 1

Callers

nothing calls this directly

Calls 1

allocate_mem_buffFunction · 0.85

Tested by

no test coverage detected