Class handling reading of an NPZ from an in-memory string stream.
More...
#include <npy.h>
|
| | npzstringreader (const std::string &bytes) |
| | Constructor.
|
| |
| | npzstringreader (std::string &&bytes) |
| | Constructor.
|
| |
| const std::vector< std::string > & | keys () const |
| | The keys of the tensors in the NPZ.
|
| |
| bool | contains (const std::string &filename) |
| | Returns whether this NPZ contains the specified tensor.
|
| |
| header_info | peek (const std::string &filename) |
| | Returns the header for a specified tensor.
|
| |
| template<typename T > |
| T | read (const std::string &filename) |
| | Read a tensor from the archive.
|
| |
| template<typename T , template< typename > class TENSOR> |
| TENSOR< T > | read (const std::string &filename) |
| |
Class handling reading of an NPZ from an in-memory string stream.
◆ npzstringreader() [1/2]
| npy::npzstringreader::npzstringreader |
( |
const std::string & |
bytes | ) |
|
Constructor.
- Parameters
-
| bytes | the contents of the stream |
◆ npzstringreader() [2/2]
| npy::npzstringreader::npzstringreader |
( |
std::string && |
bytes | ) |
|
Constructor.
- Parameters
-
| bytes | the contents of the stream |
◆ contains()
| bool npy::npzstringreader::contains |
( |
const std::string & |
filename | ) |
|
Returns whether this NPZ contains the specified tensor.
- Parameters
-
| filename | the name of the tensor in the archive |
- Returns
- whether the tensor is in the archive
◆ keys()
| const std::vector< std::string > & npy::npzstringreader::keys |
( |
| ) |
const |
The keys of the tensors in the NPZ.
◆ peek()
| header_info npy::npzstringreader::peek |
( |
const std::string & |
filename | ) |
|
Returns the header for a specified tensor.
- Parameters
-
| filename | the name of the tensor in the archive |
- Returns
- the header for the tensor
◆ read() [1/2]
template<typename T >
| T npy::npzstringreader::read |
( |
const std::string & |
filename | ) |
|
|
inline |
Read a tensor from the archive.
This method will throw an exception if the tensor does not exist, or if the data type of the tensor does not match the template type.
- Template Parameters
-
- Parameters
-
| filename | the name of the tensor in the archive |
- Returns
- an instance of T read from the archive
- See also
- npy::tensor
◆ read() [2/2]
template<typename T , template< typename > class TENSOR>
| TENSOR< T > npy::npzstringreader::read |
( |
const std::string & |
filename | ) |
|
|
inline |
The documentation for this class was generated from the following file: