pybind11 icon indicating copy to clipboard operation
pybind11 copied to clipboard

[BUG]: NPY_HALF is not supported

Open jchen351 opened this issue 3 years ago • 1 comments

Required prerequisites

  • [X] Make sure you've read the documentation. Your issue may be addressed there.
  • [X] Search the issue tracker and Discussions to verify that this hasn't already been reported. +1 or comment there if it has.
  • [x] Consider asking first in the Gitter chat room or in a Discussion.

Problem description

NPY_HALF is supported by Numpy but not yet supported by pybind11.

From numpy/ndarraytypes.h there is enum NPY_TYPES { ... NPY_HALF, ...}. However, from pybind11/numpy.h

struct npy_api {
    enum constants { ... } 

, it doesn't have NPY_HALF_

Reproducible example code

No response

jchen351 avatar Jul 13 '22 01:07 jchen351

There is a workaround here: https://github.com/pybind/pybind11/issues/1776 Since we don't support any versions of Numpy that don't have np.half anymore, I would welcome a PR that added these additions to the master.

Skylion007 avatar Jul 13 '22 18:07 Skylion007

I'm working on a PR for this and have some questions. See discussion #4627 :)

swillisart avatar Apr 22 '23 21:04 swillisart