def test_check_all_finite_sparse_infs(): """[Utils] check_all_finite: fails sparse X with infs.""" Z = X.astype('float') Z[0, 0] = np.inf assert not check_all_finite(csr.csr_matrix(Z))
def test_check_all_finite_sparse(): """[Utils] check_all_finite: passes X with sparse.""" Z = X.astype('float') Z[0, 0] = np.inf assert check_all_finite(csr.csr_matrix(X))