| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,7 +29,7 @@ Example 1: Use an algorithm of the C++ library on a numpy array inplace | |||
| 29 | 29 | ||
| 30 | 30 | PYBIND11_PLUGIN(xtensor_python_test) | |
| 31 | 31 | { | |
| 32 | - import_numpy() //this is actually a macro | ||
| 32 | + import_numpy(); //this is actually a macro | ||
| 33 | 33 | pybind11::module m("xtensor_python_test", "Test module for xtensor python bindings"); | |
| 34 | 34 | ||
| 35 | 35 | m.def("sum_of_sines", sum_of_sines, | |
@@ -80,7 +80,7 @@ Example 2: Create a universal function from a C++ scalar function | |||
| 80 | 80 | ||
| 81 | 81 | PYBIND11_PLUGIN(xtensor_python_test) | |
| 82 | 82 | { | |
| 83 | - import_numpy() | ||
| 83 | + import_numpy(); | ||
| 84 | 84 | py::module m("xtensor_python_test", "Test module for xtensor python bindings"); | |
| 85 | 85 | ||
| 86 | 86 | m.def("vectorized_func", xt::pyvectorize(scalar_func), ""); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,7 +29,7 @@ Thus the basic skeleton of the module looks like: | |||
| 29 | 29 | ||
| 30 | 30 | PYBIND11_PLUGIN(plugin_name) | |
| 31 | 31 | { | |
| 32 | - import_numpy() | ||
| 32 | + import_numpy(); | ||
| 33 | 33 | pybind11::module m(//... | |
| 34 | 34 | //... | |
| 35 | 35 | return m.ptr(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,7 +20,7 @@ int main(int argc, char* argv[]) | |||
| 20 | 20 | { | |
| 21 | 21 | // Initialize all the things (google-test and Python interpreter) | |
| 22 | 22 | Py_Initialize(); | |
| 23 | - import_numpy() | ||
| 23 | + import_numpy(); | ||
| 24 | 24 | ::testing::InitGoogleTest(&argc, argv); | |
| 25 | 25 | ||
| 26 | 26 | // Run test suite | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -51,7 +51,8 @@ int add(int i, int j) | |||
| 51 | 51 | ||
| 52 | 52 | PYBIND11_PLUGIN(xtensor_python_test) | |
| 53 | 53 | { | |
| 54 | - import_numpy() | ||
| 54 | + import_numpy(); | ||
| 55 | + | ||
| 55 | 56 | py::module m("xtensor_python_test", "Test module for xtensor python bindings"); | |
| 56 | 57 | ||
| 57 | 58 | m.def("example1", example1); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments