def test_nan_to_num():
    y = np.array([0., np.nan, np.inf, -np.inf])
    fun = lambda x: np.sum(np.sin(np.nan_to_num(x + y)))

    x = np.random.randn(4)
    check_grads(fun, x)
dataset/ETHPy150Open HIPS/autograd/tests/test_numpy.py/test_nan_to_num/original