MCPcopy Index your code
hub / github.com/zai-org/CodeGeeX / __init__

Method __init__

codegeex/megatron/model/distributed.py:27–35  ·  view source on GitHub ↗
(self, numel, dtype)

Source from the content-addressed store, hash-verified

25
26class MemoryBuffer:
27 def __init__(self, numel, dtype):
28 self.numel = numel
29 self.dtype = dtype
30 self.data = torch.zeros(
31 self.numel,
32 dtype=self.dtype,
33 device=torch.cuda.current_device(),
34 requires_grad=False,
35 )
36
37 def zero(self):
38 """Reset the buffer to zero."""

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected