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

Method astype

utils/convert.py:844–849  ·  view source on GitHub ↗
(self, data_type: DataType)

Source from the content-addressed store, hash-verified

842 return ret
843
844 def astype(self, data_type: DataType) -> LazyTensor:
845 self.validate_conversion_to(data_type)
846
847 def load() -> Tensor:
848 return self.load().astype(data_type)
849 return LazyTensor(load, self.shape, data_type, f'convert({data_type}) {self.description}')
850
851 def validate_conversion_to(self, data_type: DataType) -> None:
852 if data_type != self.data_type and data_type.name not in self.data_type.valid_conversions:

Callers

nothing calls this directly

Calls 2

LazyTensorClass · 0.70

Tested by

no test coverage detected