@@ -517,7 +517,7 @@ bool RegisterBfloat16Cast(int numpy_type, bool cast_is_safe) {
517517}
518518
519519template <typename InType, typename OutType, typename Functor>
520- void BinaryUFunc (char ** args, npy_intp* dimensions, npy_intp* steps,
520+ void BinaryUFunc (char ** args, const npy_intp* dimensions, const npy_intp* steps,
521521 void * data) {
522522 const char * i0 = args[0 ];
523523 const char * i1 = args[1 ];
@@ -532,11 +532,17 @@ void BinaryUFunc(char** args, npy_intp* dimensions, npy_intp* steps,
532532 }
533533}
534534
535+ // Numpy changed const-ness of PyUFuncGenericFunction, provide overload.
535536template <typename Functor>
536537void CompareUFunc (char ** args, npy_intp* dimensions, npy_intp* steps,
537538 void * data) {
538539 BinaryUFunc<bfloat16, npy_bool, Functor>(args, dimensions, steps, data);
539540}
541+ template <typename Functor>
542+ void CompareUFunc (char ** args, const npy_intp* dimensions,
543+ const npy_intp* steps, void * data) {
544+ BinaryUFunc<bfloat16, npy_bool, Functor>(args, dimensions, steps, data);
545+ }
540546
541547struct Bfloat16EqFunctor {
542548 npy_bool operator ()(bfloat16 a, bfloat16 b) { return a == b; }
0 commit comments