From: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> Date: Fri, 23 Sep 2022 16:58:15 +0000 (-0400) Subject: Fix SIZES for torch tensors (#4) X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=3cc41d043ed4080ffd38942cfc62fb44bd23dfb3;p=safetensors.git Fix SIZES for torch tensors (#4) --- diff --git a/bindings/python/py_src/safetensors/torch.py b/bindings/python/py_src/safetensors/torch.py index fa106db..8a44747 100644 --- a/bindings/python/py_src/safetensors/torch.py +++ b/bindings/python/py_src/safetensors/torch.py @@ -25,8 +25,12 @@ def save(tensors: Dict[str, torch.Tensor]) -> bytes: SIZE = { torch.bfloat16: 2, torch.float16: 2, + torch.float32: 4, + torch.uint8: 1, + torch.int8: 1, + torch.int16: 2, torch.int32: 4, - torch.int64: 4, + torch.int64: 8, }