-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Closed
Description
-
create cuda sparse tensor with cpu indices tensor
master:>>> torch.sparse.FloatTensor(torch.zeros(1,4).long().cuda(), torch.randn(4,4,4), [3,4,4]) Traceback (most recent call last): File "<stdin>", line 1, in <module> RuntimeError
0.4:
>>> torch.sparse.FloatTensor(torch.zeros(1,4).long().cuda(), torch.randn(4,4,4), [3,4,4]) Traceback (most recent call last): File "<stdin>", line 1, in <module> RuntimeError: Expected object of type torch.LongTensor but found type torch.cuda.LongTensor for argument #1 'indices'
-
add cuda sparse tensor to cpu dense tensor
master:>>> x = torch.zeros(3,4) >>> sparse_y = torch.cuda.sparse.FloatTensor(torch.zeros(1,4).long().cuda(), torch.randn(4,4,4).cuda(), [3,4,4]) >>> x + sparse_y [1] 2065657 segmentation fault (core dumped) python -i ~/env.py
0.4:
>>> x + sparse_y Traceback (most recent call last): File "<stdin>", line 1, in <module> RuntimeError: The size of tensor a (3) must match the size of tensor b (4) at non-singleton dimension 1
-
dense + sparse with wrong number of dimdensions
master:>>> x = torch.zeros(3,4) >>> sparse_y = torch.cuda.sparse.FloatTensor(torch.zeros(1,4).long().cuda(), torch.randn(4,4,4).cuda(), [3,4,4]) >>> x.cuda()+sparse_y tensor([[ 2.1478, -0.7767, -0.8796, -2.2104], [ 0.0000, 0.0000, 0.0000, 0.0000], [ 0.0000, 0.0000, 0.0000, 0.0000]], device='cuda:0')
0.4:
>>> x = torch.zeros(3,4) >>> sparse_y = torch.cuda.sparse.FloatTensor(torch.zeros(1,4).long().cuda(), torch.randn(4,4,4).cuda(), [3,4,4]) >>> x.cuda() + sparse_y Traceback (most recent call last): File "<stdin>", line 1, in <module> RuntimeError: The size of tensor a (3) must match the size of tensor b (4) at non-singleton dimension 1
cc @ezyang
Metadata
Metadata
Assignees
Labels
No labels