(self)
| 214 | self.weights[k] = v.half() |
| 215 | |
| 216 | def to_bfloat16(self): |
| 217 | if self.int8: |
| 218 | raise RuntimeError("Cannot cast to bfloat16 if the weights have been casted to int8.") |
| 219 | for k, v in self.weights.items(): |
| 220 | self.weights[k] = v.bfloat16() |
| 221 | |
| 222 | def to_int8(self, sparse=False, ths_path='./lib/libth_transformer.so'): |
| 223 | if self._generated_weights: |
no test coverage detected