From c3171d5d328aada46bc0f7b518142c84ecc42e74 Mon Sep 17 00:00:00 2001 From: Thomas Hrabe <3632672+thomashrabe@users.noreply.github.com> Date: Sun, 24 Jun 2018 06:41:27 -0700 Subject: [PATCH] Minor documentation clarification in numpy.rst (#1356) --- docs/advanced/pycpp/numpy.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/advanced/pycpp/numpy.rst b/docs/advanced/pycpp/numpy.rst index 98b0c25b9..50e553380 100644 --- a/docs/advanced/pycpp/numpy.rst +++ b/docs/advanced/pycpp/numpy.rst @@ -261,7 +261,7 @@ simply using ``vectorize``). namespace py = pybind11; py::array_t add_arrays(py::array_t input1, py::array_t 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"); @@ -272,7 +272,7 @@ simply using ``vectorize``). /* No pointer is passed, so NumPy will allocate the buffer */ auto result = py::array_t(buf1.size); - auto buf3 = result.request(); + py::buffer_info buf3 = result.request(); double *ptr1 = (double *) buf1.ptr, *ptr2 = (double *) buf2.ptr,