MCPcopy Create free account
hub / github.com/modelscope/modelscope / _get_diff_dim

Function _get_diff_dim

modelscope/utils/megatron_utils.py:184–188  ·  view source on GitHub ↗
(tensor1: torch.Tensor, tensor2: torch.Tensor)

Source from the content-addressed store, hash-verified

182
183
184def _get_diff_dim(tensor1: torch.Tensor, tensor2: torch.Tensor) -> int:
185 for i, (s1, s2) in enumerate(zip(tensor1.shape, tensor2.shape)):
186 if s1 != s2:
187 return i
188 return -1
189
190
191def _load_by_rank(checkpoint_dir: Union[str, bytes, os.PathLike],

Callers 2

_split_checkpointFunction · 0.85
_merge_checkpointFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…