Update convert.py

This commit is contained in:
Ivan Stepanov 2023-05-04 13:50:43 +03:00 committed by GitHub
parent e3c2421b9f
commit becce0043e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -291,7 +291,6 @@ class UnquantizedTensor(Tensor):
def astype(self, data_type: DataType) -> Tensor: def astype(self, data_type: DataType) -> Tensor:
dtype = DATA_TYPE_TO_NUMPY[data_type] dtype = DATA_TYPE_TO_NUMPY[data_type]
if self.data_type == DT_BF16: if self.data_type == DT_BF16:
self.ndarray = bf16_to_fp32(self.ndarray) self.ndarray = bf16_to_fp32(self.ndarray)
return UnquantizedTensor(self.ndarray.astype(dtype)) return UnquantizedTensor(self.ndarray.astype(dtype))