diff --git a/ml_dtypes/_src/custom_float.h b/ml_dtypes/_src/custom_float.h index 8bb7e9b6..9f292eba 100644 --- a/ml_dtypes/_src/custom_float.h +++ b/ml_dtypes/_src/custom_float.h @@ -401,7 +401,7 @@ PyArray_DescrProto GetCustomFloatDescrProto() { /*kind=*/TypeDescriptor::kNpyDescrKind, /*type=*/TypeDescriptor::kNpyDescrType, /*byteorder=*/TypeDescriptor::kNpyDescrByteorder, - /*flags=*/NPY_USE_SETITEM, + /*flags=*/NPY_NEEDS_PYAPI | NPY_USE_SETITEM, /*type_num=*/0, /*elsize=*/sizeof(T), /*alignment=*/alignof(T), diff --git a/ml_dtypes/_src/intn_numpy.h b/ml_dtypes/_src/intn_numpy.h index 7d5dbe6f..e184e0b0 100644 --- a/ml_dtypes/_src/intn_numpy.h +++ b/ml_dtypes/_src/intn_numpy.h @@ -413,7 +413,7 @@ PyArray_DescrProto GetIntNDescrProto() { /*kind=*/TypeDescriptor::kNpyDescrKind, /*type=*/TypeDescriptor::kNpyDescrType, /*byteorder=*/TypeDescriptor::kNpyDescrByteorder, - /*flags=*/NPY_USE_SETITEM, + /*flags=*/NPY_NEEDS_PYAPI | NPY_USE_SETITEM, /*type_num=*/0, /*elsize=*/sizeof(T), /*alignment=*/alignof(T),