MCPcopy Create free account
hub / github.com/microsoft/BitNet / Tensor

Class Tensor

utils/convert-ms-to-gguf-bitnet.py:702–715  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

700
701
702class Tensor(ABC):
703 ndarray: NDArray
704 data_type: DataType
705
706 @abstractmethod
707 def astype(self, data_type: DataType) -> Self: ...
708 @abstractmethod
709 def permute(self, n_head: int, n_head_kv: int) -> Self: ...
710 @abstractmethod
711 def permute_part(self, n_part: int, n_head: int, n_head_kv: int) -> Self: ...
712 @abstractmethod
713 def part(self, n_part: int) -> Self: ...
714 @abstractmethod
715 def to_ggml(self) -> GGMLCompatibleTensor: ...
716
717
718def bf16_to_fp32(bf16_arr: np.ndarray[Any, np.dtype[np.uint16]]) -> NDArray:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected