]> khamidou — GitHub mirrors - safetensors.git/commit
Zero width shape are OK (0-rank tensors). They are simply a scalar. (#208)
authorNicolas Patry <patry.nicolas@protonmail.com>
Tue, 28 Mar 2023 13:32:41 +0000 (15:32 +0200)
committerGitHub <noreply@github.com>
Tue, 28 Mar 2023 13:32:41 +0000 (15:32 +0200)
commit8375de6d25673c78de9947bded483ca3359fea82
tree5d90363abe6164bfec88e0eab2788fa4c95fd3fa
parent4ea1fe533c2d5e9a4521234bed00ba27b3307e5a
Zero width shape are OK (0-rank tensors). They are simply a scalar. (#208)

* Zero width shape are OK (0-rank tensors). They are simply a scalar.

Reasosn for support is that both torch and numpy support them, and
they flow naturally from the definition that an empty product has
length 1.

* not allowed -> allowed
safetensors/src/tensor.rs