Skip to content

Commit 0a059e1

Browse files
dvincentwestVince West
andauthored
correct example reference internal documentation (#1090)
Co-authored-by: Vince West <vince_west@apple.com>
1 parent f9ce946 commit 0a059e1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/ndarray.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,19 +238,19 @@ into a ``Matrix4f`` instance.
238238

239239
.. code-block:: cpp
240240
241-
struct Matrix4f { float m[4][4] { }; };
241+
struct Matrix4f { float data[4][4] { }; };
242242
243243
using Array = nb::ndarray<float, nb::numpy, nb::shape<4, 4>, nb::f_contig>;
244244
245245
nb::class_<Matrix4f>(m, "Matrix4f")
246246
.def(nb::init<>())
247247
.def("view",
248-
[](Matrix4f &m){ return Array(data); },
248+
[](Matrix4f &m){ return Array(m.data); },
249249
nb::rv_policy::reference_internal);
250250
251251
In this case:
252252

253-
- step 1 is the ``Array(data)`` call in the lambda function.
253+
- step 1 is the ``Array(m.data)`` call in the lambda function.
254254

255255
- step 2 occurs outside of the lambda function when the nd-array
256256
:cpp:class:`nb::ndarray\<...\> <ndarray>` :ref:`type caster <type_casters>`

0 commit comments

Comments
 (0)