Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/ndarray.rst
Original file line number Diff line number Diff line change
Expand Up @@ -526,16 +526,16 @@ overload of ``nanobind::detail::dtype_traits`` to inform nanobind about it.
You are expressively allowed to create partial overloads of this class despite
it being in the ``nanobind::detail`` namespace.

For example, the following snippet makes ``__fp16`` (half-precision type on
``aarch64``) available by providing
For example, the following snippet makes ``_Float16`` (half-precision type that
is natively supported on some hardware) available by providing

1. ``value``, a DLPack ``nanobind::dlpack::dtype`` type descriptor, and
2. ``name``, a type name for use in docstrings and error messages.

.. code-block:: cpp

namespace nanobind::detail {
template <> struct dtype_traits<__fp16> {
template <> struct dtype_traits<_Float16> {
static constexpr dlpack::dtype value {
(uint8_t) dlpack::dtype_code::Float, // type code
16, // size in bits
Expand Down