Check Arrayfire Array against NaNs
bottleneck is worth looking into.  They have performed several optimizations over the numpy.nanxxx functions which, in my experience, makes it around 5x faster than numpy.
I'm using Arrayfire on Python and I can't use the af.sum() function since my input array has NaNs in it and it would return NAN as sum.
Using numpy.nansum/numpy.nan_to_num is not an option due to speed problems.
I just need a way to convert those NaNs to floating point zeros in arrayfire.