Skip to content

Commit 534b756

Browse files
thomashrabewjakob
authored andcommitted
Minor documentation clarification in numpy.rst (#1356)
1 parent baf6b99 commit 534b756

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/advanced/pycpp/numpy.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ simply using ``vectorize``).
261261
namespace py = pybind11;
262262
263263
py::array_t<double> add_arrays(py::array_t<double> input1, py::array_t<double> input2) {
264-
auto buf1 = input1.request(), buf2 = input2.request();
264+
py::buffer_info buf1 = input1.request(), buf2 = input2.request();
265265
266266
if (buf1.ndim != 1 || buf2.ndim != 1)
267267
throw std::runtime_error("Number of dimensions must be one");
@@ -272,7 +272,7 @@ simply using ``vectorize``).
272272
/* No pointer is passed, so NumPy will allocate the buffer */
273273
auto result = py::array_t<double>(buf1.size);
274274
275-
auto buf3 = result.request();
275+
py::buffer_info buf3 = result.request();
276276
277277
double *ptr1 = (double *) buf1.ptr,
278278
*ptr2 = (double *) buf2.ptr,

0 commit comments

Comments
 (0)