Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
534b756c
Commit
534b756c
authored
Jun 24, 2018
by
Thomas Hrabe
Committed by
Wenzel Jakob
Jun 24, 2018
Browse files
Minor documentation clarification in numpy.rst (#1356)
parent
baf6b990
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
docs/advanced/pycpp/numpy.rst
docs/advanced/pycpp/numpy.rst
+2
-2
No files found.
docs/advanced/pycpp/numpy.rst
View file @
534b756c
...
@@ -261,7 +261,7 @@ simply using ``vectorize``).
...
@@ -261,7 +261,7 @@ simply using ``vectorize``).
namespace py = pybind11;
namespace py = pybind11;
py::array_t<double> add_arrays(py::array_t<double> input1, py::array_t<double> input2) {
py::array_t<double> add_arrays(py::array_t<double> input1, py::array_t<double> input2) {
aut
o buf1 = input1.request(), buf2 = input2.request();
py::buffer_inf
o buf1 = input1.request(), buf2 = input2.request();
if (buf1.ndim != 1 || buf2.ndim != 1)
if (buf1.ndim != 1 || buf2.ndim != 1)
throw std::runtime_error("Number of dimensions must be one");
throw std::runtime_error("Number of dimensions must be one");
...
@@ -272,7 +272,7 @@ simply using ``vectorize``).
...
@@ -272,7 +272,7 @@ simply using ``vectorize``).
/* No pointer is passed, so NumPy will allocate the buffer */
/* No pointer is passed, so NumPy will allocate the buffer */
auto result = py::array_t<double>(buf1.size);
auto result = py::array_t<double>(buf1.size);
aut
o buf3 = result.request();
py::buffer_inf
o buf3 = result.request();
double *ptr1 = (double *) buf1.ptr,
double *ptr1 = (double *) buf1.ptr,
*ptr2 = (double *) buf2.ptr,
*ptr2 = (double *) buf2.ptr,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment