11#include " cholesky_solver.h"
22#include " docstr.h"
33#include < nanobind/nanobind.h>
4- #include < nanobind/tensor .h>
4+ #include < nanobind/ndarray .h>
55
66#define STRINGIFY (x ) #x
77#define MACRO_STRINGIFY (x ) STRINGIFY(x)
@@ -20,9 +20,9 @@ void declare_cholesky(nb::module_ &m, const std::string &typestr, const char *do
2020 nb::class_<Class>(m, class_name.c_str (), docstr)
2121 .def (" __init__" , [](Class *self,
2222 uint32_t n_rows,
23- nb::tensor <int32_t , nb::shape<nb::any>, nb::c_contig> ii,
24- nb::tensor <int32_t , nb::shape<nb::any>, nb::c_contig> jj,
25- nb::tensor <double , nb::shape<nb::any>, nb::c_contig> x,
23+ nb::ndarray <int32_t , nb::shape<nb::any>, nb::c_contig> ii,
24+ nb::ndarray <int32_t , nb::shape<nb::any>, nb::c_contig> jj,
25+ nb::ndarray <double , nb::shape<nb::any>, nb::c_contig> x,
2626 MatrixType type) {
2727
2828 if (type == MatrixType::COO){
@@ -78,8 +78,8 @@ void declare_cholesky(nb::module_ &m, const std::string &typestr, const char *do
7878 nb::arg (" type" ),
7979 doc_constructor)
8080 .def (" solve" , [](Class &self,
81- nb::tensor <Float, nb::c_contig> b,
82- nb::tensor <Float, nb::c_contig> x){
81+ nb::ndarray <Float, nb::c_contig> b,
82+ nb::ndarray <Float, nb::c_contig> x){
8383 if (b.ndim () != 1 && b.ndim () != 2 )
8484 throw std::invalid_argument (" Expected 1D or 2D tensors as input." );
8585 if (b.shape (0 ) != x.shape (0 ) || (b.ndim () == 2 && b.shape (1 ) != x.shape (1 )))
0 commit comments