Repository navigation
handle np.nan and np.inf constant values properly in ndimage functions - #4083
Conversation
06a0af6 to
eb607a8
Compare
Currently non-finite cval is only supported in cases where the output is floating point. Otherwise NotImplementedError is returned.
Note: rank filters do not support cval=np.nan. It was observed that NaN handling in general is not SciPy compatible for the rank filters
|
This PR now covers all ndimage filters and not only the interpolation functions. The behavior with non-finite The behavior with the change made here did NOT match SciPy if the output array had integer dtype. It seems conversion from One other corner case discovered here is that all of the rank filters do not preserve NaNs as in SciPy (see #4090), so unless that is fixed we also cannot support |
|
Jenkins, test this please |
|
Jenkins CI test (for commit fec9b41, target branch master) succeeded! |
handle np.nan and np.inf constant values properly in ndimage functions
SciPy's interpolation routines with mode='constant' allow the constant value to be
np.nan,np.infor-np.inf, but these currently cause compilation failure in CuPy.closes #4082
I will add test cases in a bit and look into whether we might want to have a similar change for ndimage filters, etc.