
Read tensors from a safetensors file.
safetensors_read.Rdsafetensors (https://github.com/huggingface/safetensors) is the simple tensor serialisation format used across the machine-learning ecosystem, typically for model weights.
Details
Returns a named list of R arrays indexed exactly like the source
torch tensors (x[i, j, ...] agrees elementwise): the row-major
payload is reshaped through the reversed dims and apermed back.
F32 tensors only; others (e.g. I64 num_batches_tracked) are
silently dropped. A 0-d tensor becomes a length-1 vector.
See also
safetensors_ls() to list a file's tensors without
reading data.