Skip to content

function save_to_npy(const tensor<T, Dims> &, Fn &&) tensor

template <typename T, index_t Dims, typename Fn>
void save_to_npy(const tensor<T, Dims>& t, Fn&& write_callback)

Saves a tensor to .npy format using a custom write callback.

The write callback must match the signature: void(const void* data, size_t write_size)

Template parameters
T Element type of the tensor.
Dims Number of dimensions.
Fn Write callback type.
Parameters
t Tensor to save.
write_callback Callback used to write binary data.

Defined at base/npy.hpp:366