def test_18934_empty_leaky_relu(): arr = np.random.rand(0,2) arr_grad = np.empty_like(arr) autograd.mark_variables([arr], [arr_grad]) with autograd.record(): res = npx.leaky_relu(arr) res.backward()
def test_18927(): """test for no error when dealing with zero-size array in bipartite matching""" arr = np.random.rand(0,2) arr_grad = np.empty_like(arr) autograd.mark_variables([arr], [arr_grad]) with autograd.record(): a = npx.bipartite_matching(arr, threshold=0.1) a[0].backward()
def test_18933_channel_0(): arr = np.random.rand(1,0,1) # channel = 0 arr_grad = np.empty_like(arr) gamma = np.random.rand(1) gamma_grad = np.empty_like(gamma) beta = np.random.rand(1) beta_grad = np.empty_like(beta) autograd.mark_variables([arr, gamma, beta], [arr_grad, gamma_grad, beta_grad]) with autograd.record(): a = npx.instance_norm(arr, gamma, beta) a.backward()