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.