]> khamidou — GitHub mirrors - safetensors.git/commit
Added method `len` on `SafeTensors` (#252)
authorFuntowicz Morgan <mfuntowicz@users.noreply.github.com>
Mon, 22 May 2023 13:26:06 +0000 (15:26 +0200)
committerGitHub <noreply@github.com>
Mon, 22 May 2023 13:26:06 +0000 (15:26 +0200)
commita03528d558d4df92fc0ce65693f44efd07767152
tree464275ab4b58b9e8f778bc808760547b80eb01da
parentc6bb516bddcb562ccf1402777f07d0519fca19a6
Added method `len` on `SafeTensors`  (#252)

* Added method `len` on `SafeTensors` in order to avoid allocating a new tensor through `names()` or `tensors()`

* Make clippy happy with `is_empty() -> bool`

* Apply @Narsil suggestion regarding is_empty

Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
* Fix format.

---------

Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
safetensors/src/tensor.rs