Commit 0a5eeead authored by rusty1s's avatar rusty1s
Browse files

first cuda, then variable call

parent 4d8ff02a
......@@ -35,12 +35,12 @@ def test_backward_cpu(tensor, i):
@pytest.mark.parametrize('tensor,i', product(tensors, range(len(data))))
def test_backward_gpu(tensor, i): # pragma: no cover
name = data[i]['name']
index = V(torch.LongTensor(data[i]['index'])).cuda()
input = V(Tensor(tensor, data[i]['input']), requires_grad=True).cuda()
index = V(torch.LongTensor(data[i]['index']).cuda())
input = V(Tensor(tensor, data[i]['input']).cuda(), requires_grad=True)
dim = data[i]['dim']
fill_value = data[i]['fill_value']
grad = Tensor(tensor, data[i]['grad']).cuda()
output = V(grad.new(grad.size()).fill_(fill_value)).cuda()
output = V(grad.new(grad.size()).fill_(fill_value).cuda())
expected = Tensor(tensor, data[i]['expected'])
func = getattr(torch_scatter, 'scatter_{}_'.format(name))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment