MCPcopy Index your code
hub / github.com/microsoft/BitNet / permute_lazy

Function permute_lazy

utils/convert.py:924–927  ·  view source on GitHub ↗
(lazy_tensor: LazyTensor, n_head: int, n_head_kv: int)

Source from the content-addressed store, hash-verified

922
923
924def permute_lazy(lazy_tensor: LazyTensor, n_head: int, n_head_kv: int) -> LazyTensor:
925 def load() -> Tensor:
926 return lazy_tensor.load().permute(n_head, n_head_kv)
927 return LazyTensor(load, lazy_tensor.shape, lazy_tensor.data_type, f'permute({n_head}, {n_head_kv}) ' + lazy_tensor.description)
928
929
930def permute_part_lazy(lazy_tensor: LazyTensor, n_part: int, n_head: int, n_head_kv: int) -> LazyTensor:

Callers 1

convert_model_namesFunction · 0.70

Calls 1

LazyTensorClass · 0.70

Tested by

no test coverage detected