MCPcopy
hub / github.com/Simple-Efficient/RL-Factory / get

Method get

verl/utils/memory_buffer.py:43–50  ·  view source on GitHub ↗

Return a tensor with the input `shape` as a view into the 1-D data starting at `start_index`.

(self, shape, start_index)

Source from the content-addressed store, hash-verified

41 self.data.zero_()
42
43 def get(self, shape, start_index):
44 """Return a tensor with the input `shape` as a view into the
45 1-D data starting at `start_index`."""
46 end_index = start_index + shape.numel()
47 assert end_index <= self.numel, "requested tensor is out of the buffer range."
48 buffer_tensor = self.data[start_index:end_index]
49 buffer_tensor = buffer_tensor.view(shape)
50 return buffer_tensor
51
52
53def calc_padded_numel(shape: torch.Size, dtype: torch.dtype):

Callers 15

executeMethod · 0.45
default_tp_concat_fnFunction · 0.45
_get_attrFunction · 0.45
apply_fsdp2Function · 0.45
estimate_flopsMethod · 0.45
__init__Method · 0.45
__init__Method · 0.45
wrapper_mpFunction · 0.45
from_nameMethod · 0.45
vllm_generateFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected