write_npy#

Write an NPY file from a tensor

Note

This function requires the optional MATX_ENABLE_FILEIO compile flag

template<typename TensorType>
void matx::io::write_npy(const TensorType &t, const std::string &fname)#

Write a NPY file from a tensor view.

NPY files are a simple binary format for storing arrays of numbers.

Template Parameters:

TensorType – Data type of tensor

Parameters:
  • t – Tensor to write data from

  • fname – File name of .npy file

Examples#

io::write_npy(t, "test_write.npy");