MCPcopy
hub / github.com/InternLM/lmdeploy / get

Method get

lmdeploy/turbomind/checkpoint.py:63–72  ·  view source on GitHub ↗

Read the tensor at ``self.prefix + sep + name``. Empty ``name`` reads the tensor at the exact prefix. Raises ``KeyError`` on miss (delegates to checkpoint). If ``index`` is not None, the checkpoint slices the tensor along dim 0 on CPU before transferring to GPU.

(self, name: str = '', sep: str = '.', *, index=None)

Source from the content-addressed store, hash-verified

61 # ----- tensor access -----
62
63 def get(self, name: str = '', sep: str = '.', *, index=None) -> torch.Tensor:
64 """Read the tensor at ``self.prefix + sep + name``.
65
66 Empty ``name`` reads the tensor at the exact prefix. Raises
67 ``KeyError`` on miss (delegates to checkpoint).
68
69 If ``index`` is not None, the checkpoint slices the tensor along
70 dim 0 on CPU before transferring to GPU.
71 """
72 return self.ckpt.get(self._joined(name, sep), index=index)
73
74 def has(self, name: str = '', sep: str = '.') -> bool:
75 return self.ckpt.has(self._joined(name, sep))

Callers 15

gen_packages_itemsFunction · 0.45
can_colorizeFunction · 0.45
formatMethod · 0.45
__init__Method · 0.45
chatMethod · 0.45
sessionMethod · 0.45
get_pplMethod · 0.45
_request_generatorMethod · 0.45
check_vl_llmFunction · 0.45
get_model_archFunction · 0.45
chat_templateMethod · 0.45

Calls 1

_joinedMethod · 0.95

Tested by 15

shared_ray_managerFunction · 0.36
quantization_allFunction · 0.36
quantization_w8a8Function · 0.36
test_repeatFunction · 0.36
run_eval_testFunction · 0.36
run_eval_testFunction · 0.36