Skip to content

Commit

Permalink
Minor documentation clarification in numpy.rst (pybind#1356)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomashrabe authored and wjakob committed Jun 24, 2018
1 parent baf6b99 commit 534b756
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/advanced/pycpp/numpy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ simply using ``vectorize``).
namespace py = pybind11;
py::array_t<double> add_arrays(py::array_t<double> input1, py::array_t<double> input2) {
auto buf1 = input1.request(), buf2 = input2.request();
py::buffer_info buf1 = input1.request(), buf2 = input2.request();
if (buf1.ndim != 1 || buf2.ndim != 1)
throw std::runtime_error("Number of dimensions must be one");
Expand All @@ -272,7 +272,7 @@ simply using ``vectorize``).
/* No pointer is passed, so NumPy will allocate the buffer */
auto result = py::array_t<double>(buf1.size);
auto buf3 = result.request();
py::buffer_info buf3 = result.request();
double *ptr1 = (double *) buf1.ptr,
*ptr2 = (double *) buf2.ptr,
Expand Down

0 comments on commit 534b756

Please sign in to comment.