BFloat16 not supported
nachshonc opened this issue · comments
nachshonc commented
Code fails when printing a tensor in bfloat16.
Minimal code to reproduce:
import torch
import lovely_tensors
lovely_tensors.monkey_patch()
t = torch.tensor([1.0], dtype=torch.bfloat16)
print(t)
lovely_tensors version is 0.1.11.
Error message
--> 138 common = np_to_str_common(t.detach().cpu().numpy(), color=color, ddof=1)
139 else:
140 common = torch_to_str_common(t, color=color)
TypeError: Got unsupported ScalarType BFloat16
bfloat16 is used for T5-like text generation models.
Alexey Zaytsev commented
Good catch, thank you. I'll try to fix this today.
Alexey Zaytsev commented
Fixed. I'll release a new version soon. If you'd like to try git:
pip install git+https://github.com/xl0/lovely-tensors