MCPcopy Create free account
hub / github.com/BeastyZ/ConvSearch-R1 / __init__

Method __init__

verl/verl/utils/memory_buffer.py:30–37  ·  view source on GitHub ↗
(self, numel: int, numel_padded: int, dtype: torch.dtype, source: Optional[torch.Tensor] = None)

Source from the content-addressed store, hash-verified

28 """
29
30 def __init__(self, numel: int, numel_padded: int, dtype: torch.dtype, source: Optional[torch.Tensor] = None):
31 self.numel = numel
32 self.numel_padded = numel_padded
33 self.dtype = dtype
34 if source is not None:
35 self.data = source
36 else:
37 self.data = torch.zeros(self.numel_padded, dtype=self.dtype, device='cuda', requires_grad=False)
38
39 def zero(self):
40 """Reset the buffer to zero."""

Callers 1

__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected