| 28 | |
| 29 | template<typename Derived> |
| 30 | Derived load_matrix(const std::string& filename) { |
| 31 | std::vector<int> shape; |
| 32 | std::vector<typename Derived::Scalar> data; |
| 33 | aoba::LoadArrayFromNumpy(filename, shape, data); |
| 34 | assert(shape.size() == 2); |
| 35 | |
| 36 | Derived M(shape[0], shape[1]); |
| 37 | std::copy(data.begin(), data.end(), M.data()); |
| 38 | return M; |
| 39 | } |
| 40 | } |
| 41 | } |
nothing calls this directly
no test coverage detected