|
libnpy 2.0.0
Lightweight C++ library for reading and writing NPY and NPZ files
|
Class which handles writing of an NPZ to an in-memory string stream. More...
#include <npy.h>
Public Member Functions | |
| npzstringwriter (compression_method_t compression=compression_method_t::STORED, endian_t endianness=npy::endian_t::NATIVE) | |
| Constructor. | |
| ~npzstringwriter () | |
| Destructor. This will call npy::npzstringwriter::close, if it has not been called already. | |
| std::string | str () const |
| Returns the contents of the string stream as a string. | |
| void | close () |
| Writes the directory and end-matter of the NPZ file. Further writes will fail. | |
| template<typename T > | |
| void | write (const std::string &filename, const T &tensor) |
| Write a tensor to the NPZ archive. | |
Class which handles writing of an NPZ to an in-memory string stream.
| npy::npzstringwriter::npzstringwriter | ( | compression_method_t | compression = compression_method_t::STORED, |
| endian_t | endianness = npy::endian_t::NATIVE |
||
| ) |
Constructor.
| compression | how the entries should be compressed |
| endianness | the endianness to use in writing the entries |
| npy::npzstringwriter::~npzstringwriter | ( | ) |
Destructor. This will call npy::npzstringwriter::close, if it has not been called already.
| void npy::npzstringwriter::close | ( | ) |
Writes the directory and end-matter of the NPZ file. Further writes will fail.
| std::string npy::npzstringwriter::str | ( | ) | const |
Returns the contents of the string stream as a string.
|
inline |
Write a tensor to the NPZ archive.
| T | the tensor type |
| filename | the name of the file in the archive |
| tensor | the tensor to write |