Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check Arrayfire Array against NaNs

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.

like image 518
ggdm Avatar asked Jul 31 '26 22:07

ggdm


1 Answers

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.

like image 166
tnknepp Avatar answered Aug 02 '26 12:08

tnknepp



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!