Skip to content

Commit

Permalink
minor fix for bfloat16 (#7003)
Browse files Browse the repository at this point in the history
  • Loading branch information
lhoestq authored Jun 25, 2024
1 parent bfb0a41 commit 1e1d313
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/datasets/utils/_dill.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def _save_torchTensor(pickler, obj):
def create_torchTensor(np_array, dtype=None):
tensor = torch.from_numpy(np_array)
if dtype:
tensor = tensor.type(torch.bfloat16)
tensor = tensor.type(dtype)
return tensor

log(pickler, f"To: {obj}")
Expand Down

0 comments on commit 1e1d313

Please sign in to comment.