MCPcopy Create free account
hub / github.com/Pints-AI/1.5-Pints / permute_lazy

Function permute_lazy

tokenizer/convert/convert.py:738–741  ·  view source on GitHub ↗
(lazy_tensor: LazyTensor, n_head: int, n_head_kv: int)

Source from the content-addressed store, hash-verified

736
737
738def permute_lazy(lazy_tensor: LazyTensor, n_head: int, n_head_kv: int) -> LazyTensor:
739 def load() -> Tensor:
740 return lazy_tensor.load().permute(n_head, n_head_kv)
741 return LazyTensor(load, lazy_tensor.shape, lazy_tensor.data_type, f'permute({n_head}, {n_head_kv}) ' + lazy_tensor.description)
742
743
744def permute_part_lazy(lazy_tensor: LazyTensor, n_part: int, n_head: int, n_head_kv: int) -> LazyTensor:

Callers 1

convert_model_namesFunction · 0.85

Calls 1

LazyTensorClass · 0.85

Tested by

no test coverage detected