tensor: numpy file i/o

This commit is contained in:
2026-03-09 18:34:56 +01:00
parent 302055db86
commit fa59833e1e
4 changed files with 142 additions and 2 deletions

View File

@@ -279,6 +279,10 @@ public:
//subtensor - todo: more general versions
Tensor subtensor1(int i) const; //for one value of rightmost index
//numpy interface
void numpy_write(const char *name, const char *descr="<f8") const;
void numpy_read(const char *name);
//conversions from/to matrix and vector
explicit Tensor(const NRVec<T> &x);
explicit Tensor(const NRMat<T> &x, bool flat=false);