Skip to content

Commit b90817a

Browse files
committed
README: Example 2 fixed
1 parent b2ce69d commit b90817a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ s
8686

8787
```cpp
8888
#include "pybind11/pybind11.h"
89+
#define FORCE_IMPORT_ARRAY
8990
#include "xtensor-python/pyvectorize.hpp"
9091
#include <numeric>
9192
#include <cmath>
@@ -99,6 +100,7 @@ double scalar_func(double i, double j)
99100

100101
PYBIND11_MODULE(xtensor_python_test, m)
101102
{
103+
xt::import_numpy();
102104
m.doc() = "Test module for xtensor python bindings";
103105

104106
m.def("vectorized_func", xt::pyvectorize(scalar_func), "");

0 commit comments

Comments
 (0)