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

Method get

codegeex/megatron/model/distributed.py:41–48  ·  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

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

Callers 15

load_checkpointFunction · 0.45
get_num_microbatchesFunction · 0.45
_set_adlr_autoresumeFunction · 0.45
training_logFunction · 0.45
evaluateFunction · 0.45
__init__Method · 0.45
from_pretrainedMethod · 0.45
bpeMethod · 0.45
convert_tokens_to_idsMethod · 0.45
restore_checkpointFunction · 0.45
load_modelFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected