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

Function pack_experts_lazy

utils/convert.py:946–952  ·  view source on GitHub ↗
(lazy_tensors: list[LazyTensor])

Source from the content-addressed store, hash-verified

944
945
946def pack_experts_lazy(lazy_tensors: list[LazyTensor]) -> LazyTensor:
947 def load() -> Tensor:
948 tensors = [lazy_tensor.load() for lazy_tensor in lazy_tensors]
949 return UnquantizedTensor(np.array([tensor.ndarray for tensor in tensors]))
950 s = lazy_tensors[0].shape.copy()
951 s.insert(0, len(lazy_tensors))
952 return LazyTensor(load, s, lazy_tensors[0].data_type, 'pack_experts ' + ' | '.join(lt.description for lt in lazy_tensors))
953
954
955def lazy_load_safetensors_file(fp: IO[bytes], path: Path) -> ModelPlus:

Callers 1

convert_model_namesFunction · 0.70

Calls 1

LazyTensorClass · 0.70

Tested by

no test coverage detected