MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / astype

Method astype

convert.py:483–487  ·  view source on GitHub ↗
(self, data_type: DataType)

Source from the content-addressed store, hash-verified

481 self.data_type = NUMPY_TYPE_TO_DATA_TYPE[ndarray.dtype]
482
483 def astype(self, data_type: DataType) -> Tensor:
484 dtype = data_type.dtype
485 if self.data_type == DT_BF16:
486 self.ndarray = bf16_to_fp32(self.ndarray)
487 return UnquantizedTensor(self.ndarray.astype(dtype))
488
489 def to_ggml(self) -> UnquantizedTensor:
490 return self

Callers

nothing calls this directly

Calls 3

bf16_to_fp32Function · 0.70
UnquantizedTensorClass · 0.70
astypeMethod · 0.45

Tested by

no test coverage detected