There was an error while loading. Please reload this page.
1 parent 5bb315c commit 13be687Copy full SHA for 13be687
lib/core_ext.cpp
@@ -13,7 +13,7 @@
13
namespace nb = nanobind;
14
15
using CoeffNdarrayT = nb::ndarray<const double, nb::ndim<1>, nb::any_contig>;
16
-using IndexNdarrayT = nb::ndarray<int, nb::ndim<1>, nb::any_contig>;
+using IndexNdarrayT = nb::ndarray<const int, nb::ndim<1>, nb::any_contig>;
17
18
NB_MODULE(core_ext, m)
19
{
tests/test_basic.py
@@ -72,7 +72,9 @@ def test_basic():
72
def test_affineexpr_from_numpy():
73
N = 25
74
coefs = np.arange(N, dtype=np.float64)
75
- vars = np.arange(N, dtype=np.int_)
+ vars = np.arange(N, dtype=np.int_) * 2
76
+ coefs.flags.writeable = False
77
+ vars.flags.writeable = False
78
79
expr = poi.ScalarAffineFunction.from_numpy(coefs, vars)
80
0 commit comments