File tree Expand file tree Collapse file tree 4 files changed +6
-6
lines changed
Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ Both containers enable the numpy-style APIs of xtensor (see [the numpy to xtenso
4545#include < numeric> // Standard library import for std::accumulate
4646#include " pybind11/pybind11.h" // Pybind11 import to define Python bindings
4747#include " xtensor/xmath.hpp" // xtensor import for the C++ universal functions
48+ #define FORCE_IMPORT_ARRAY
4849#include " xtensor-python/pyarray.hpp" // Numpy bindings
4950
5051double sum_of_sines (xt::pyarray<double >& m)
@@ -55,6 +56,7 @@ double sum_of_sines(xt::pyarray<double>& m)
5556
5657PYBIND11_PLUGIN(xtensor_python_test)
5758{
59+ xt::import_numpy();
5860 pybind11::module m("xtensor_python_test", "Test module for xtensor python bindings");
5961
6062 m.def("sum_of_sines", sum_of_sines, "Sum the sines of the input values");
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ Thus the basic skeleton of the module looks like:
2525
2626 #include "pybind11/pybind11.h"
2727 #define FORCE_IMPORT_ARRAY
28- #include "xgtensor -python/pyarray.hpp"
28+ #include "xtensor -python/pyarray.hpp"
2929
3030 PYBIND11_PLUGIN(plugin_name)
3131 {
Original file line number Diff line number Diff line change 2121#include " pystrides_adaptor.hpp"
2222#include " xtensor_type_caster_base.hpp"
2323
24- #include < iostream>
25-
2624namespace xt
2725{
2826 template <class T >
Original file line number Diff line number Diff line change 1- /*
1+ /*
22 xtensor-python/xtensor_type_caster.hpp: Transparent conversion for xtensor and xarray
33
4- This code is based on the following code written by Wenzei Jakob
4+ This code is based on the following code written by Wenzel Jakob
55
66 pybind11/eigen.h: Transparent conversion for dense and sparse Eigen matrices
77
@@ -78,7 +78,7 @@ namespace pybind11
7878 }
7979
8080 private:
81-
81+
8282 // Cast implementation
8383 template <typename CType>
8484 static handle cast_impl (CType* src, return_value_policy policy, handle parent)
You can’t perform that action at this time.
0 commit comments