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

Function allocate_mem_buff

codegeex/megatron/memory.py:24–28  ·  view source on GitHub ↗

Allocate a memory buffer.

(name, numel, dtype, track_usage)

Source from the content-addressed store, hash-verified

22
23
24def allocate_mem_buff(name, numel, dtype, track_usage):
25 """Allocate a memory buffer."""
26 assert name not in _MEM_BUFFS, "memory buffer {} already allocated.".format(name)
27 _MEM_BUFFS[name] = MemoryBuffer(name, numel, dtype, track_usage)
28 return _MEM_BUFFS[name]
29
30
31def get_mem_buff(name):

Callers 2

__init__Method · 0.85

Calls 1

MemoryBufferClass · 0.70

Tested by

no test coverage detected