pytorch/test/expect/TestSparseCompressedCUDA.test_print_SparseCSC_cuda.expect
Pearu Peterson cde365a7cd Validate Sparse Compressed tensor inputs (#79385)
The validation includes regular tensor inputs, batched tensor inputs, as well as hybrid tensor inputs.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79385
Approved by: https://github.com/nikitaved, https://github.com/cpuhrsch
2022-06-27 17:19:54 +00:00

379 lines
12 KiB
Text

########## torch.float32/torch.int32/batch_shape=()/block_shape=() ##########
# sparse tensor
tensor(ccol_indices=tensor([0, 2, 4]),
row_indices=tensor([0, 1, 0, 2]),
values=tensor([1., 2., 3., 4.]), device='cuda:0', size=(3, 2), nnz=4,
layout=torch.sparse_csc)
# _ccol_indices
tensor([0, 2, 4], device='cuda:0', dtype=torch.int32)
# _row_indices
tensor([0, 1, 0, 2], device='cuda:0', dtype=torch.int32)
# _values
tensor([1., 2., 3., 4.], device='cuda:0')
########## torch.float32/torch.int32/batch_shape=()/block_shape=() ##########
# sparse tensor
tensor(ccol_indices=tensor([0]),
row_indices=tensor([], size=(0,)),
values=tensor([], size=(0,)), device='cuda:0', size=(0, 0), nnz=0,
layout=torch.sparse_csc)
# _ccol_indices
tensor([0], device='cuda:0', dtype=torch.int32)
# _row_indices
tensor([], device='cuda:0', dtype=torch.int32)
# _values
tensor([], device='cuda:0')
########## torch.float32/torch.int32/batch_shape=(2,)/block_shape=() ##########
# sparse tensor
tensor(ccol_indices=tensor([[0, 2, 4],
[0, 3, 4]]),
row_indices=tensor([[0, 1, 0, 1],
[0, 1, 2, 0]]),
values=tensor([[1., 2., 3., 4.],
[5., 6., 7., 8.]]), device='cuda:0', size=(2, 3, 2),
nnz=4, layout=torch.sparse_csc)
# _ccol_indices
tensor([[0, 2, 4],
[0, 3, 4]], device='cuda:0', dtype=torch.int32)
# _row_indices
tensor([[0, 1, 0, 1],
[0, 1, 2, 0]], device='cuda:0', dtype=torch.int32)
# _values
tensor([[1., 2., 3., 4.],
[5., 6., 7., 8.]], device='cuda:0')
########## torch.float32/torch.int32/batch_shape=(2, 3)/block_shape=() ##########
# sparse tensor
tensor(ccol_indices=tensor([[[0, 2, 4],
[0, 3, 4],
[0, 1, 4]],
[[0, 1, 4],
[0, 2, 4],
[0, 3, 4]]]),
row_indices=tensor([[[0, 1, 0, 1],
[0, 1, 2, 0],
[0, 0, 1, 2]],
[[1, 0, 1, 2],
[0, 2, 0, 1],
[0, 1, 2, 1]]]),
values=tensor([[[ 1., 2., 3., 4.],
[ 5., 6., 7., 8.],
[ 9., 10., 11., 12.]],
[[13., 14., 15., 16.],
[17., 18., 19., 20.],
[21., 22., 23., 24.]]]), device='cuda:0',
size=(2, 3, 3, 2), nnz=4, layout=torch.sparse_csc)
# _ccol_indices
tensor([[[0, 2, 4],
[0, 3, 4],
[0, 1, 4]],
[[0, 1, 4],
[0, 2, 4],
[0, 3, 4]]], device='cuda:0', dtype=torch.int32)
# _row_indices
tensor([[[0, 1, 0, 1],
[0, 1, 2, 0],
[0, 0, 1, 2]],
[[1, 0, 1, 2],
[0, 2, 0, 1],
[0, 1, 2, 1]]], device='cuda:0', dtype=torch.int32)
# _values
tensor([[[ 1., 2., 3., 4.],
[ 5., 6., 7., 8.],
[ 9., 10., 11., 12.]],
[[13., 14., 15., 16.],
[17., 18., 19., 20.],
[21., 22., 23., 24.]]], device='cuda:0')
########## torch.float64/torch.int32/batch_shape=()/block_shape=() ##########
# sparse tensor
tensor(ccol_indices=tensor([0, 2, 4]),
row_indices=tensor([0, 1, 0, 2]),
values=tensor([1., 2., 3., 4.]), device='cuda:0', size=(3, 2), nnz=4,
dtype=torch.float64, layout=torch.sparse_csc)
# _ccol_indices
tensor([0, 2, 4], device='cuda:0', dtype=torch.int32)
# _row_indices
tensor([0, 1, 0, 2], device='cuda:0', dtype=torch.int32)
# _values
tensor([1., 2., 3., 4.], device='cuda:0', dtype=torch.float64)
########## torch.float64/torch.int32/batch_shape=()/block_shape=() ##########
# sparse tensor
tensor(ccol_indices=tensor([0]),
row_indices=tensor([], size=(0,)),
values=tensor([], size=(0,)), device='cuda:0', size=(0, 0), nnz=0,
dtype=torch.float64, layout=torch.sparse_csc)
# _ccol_indices
tensor([0], device='cuda:0', dtype=torch.int32)
# _row_indices
tensor([], device='cuda:0', dtype=torch.int32)
# _values
tensor([], device='cuda:0', dtype=torch.float64)
########## torch.float64/torch.int32/batch_shape=(2,)/block_shape=() ##########
# sparse tensor
tensor(ccol_indices=tensor([[0, 2, 4],
[0, 3, 4]]),
row_indices=tensor([[0, 1, 0, 1],
[0, 1, 2, 0]]),
values=tensor([[1., 2., 3., 4.],
[5., 6., 7., 8.]]), device='cuda:0', size=(2, 3, 2),
nnz=4, dtype=torch.float64, layout=torch.sparse_csc)
# _ccol_indices
tensor([[0, 2, 4],
[0, 3, 4]], device='cuda:0', dtype=torch.int32)
# _row_indices
tensor([[0, 1, 0, 1],
[0, 1, 2, 0]], device='cuda:0', dtype=torch.int32)
# _values
tensor([[1., 2., 3., 4.],
[5., 6., 7., 8.]], device='cuda:0', dtype=torch.float64)
########## torch.float64/torch.int32/batch_shape=(2, 3)/block_shape=() ##########
# sparse tensor
tensor(ccol_indices=tensor([[[0, 2, 4],
[0, 3, 4],
[0, 1, 4]],
[[0, 1, 4],
[0, 2, 4],
[0, 3, 4]]]),
row_indices=tensor([[[0, 1, 0, 1],
[0, 1, 2, 0],
[0, 0, 1, 2]],
[[1, 0, 1, 2],
[0, 2, 0, 1],
[0, 1, 2, 1]]]),
values=tensor([[[ 1., 2., 3., 4.],
[ 5., 6., 7., 8.],
[ 9., 10., 11., 12.]],
[[13., 14., 15., 16.],
[17., 18., 19., 20.],
[21., 22., 23., 24.]]]), device='cuda:0',
size=(2, 3, 3, 2), nnz=4, dtype=torch.float64, layout=torch.sparse_csc)
# _ccol_indices
tensor([[[0, 2, 4],
[0, 3, 4],
[0, 1, 4]],
[[0, 1, 4],
[0, 2, 4],
[0, 3, 4]]], device='cuda:0', dtype=torch.int32)
# _row_indices
tensor([[[0, 1, 0, 1],
[0, 1, 2, 0],
[0, 0, 1, 2]],
[[1, 0, 1, 2],
[0, 2, 0, 1],
[0, 1, 2, 1]]], device='cuda:0', dtype=torch.int32)
# _values
tensor([[[ 1., 2., 3., 4.],
[ 5., 6., 7., 8.],
[ 9., 10., 11., 12.]],
[[13., 14., 15., 16.],
[17., 18., 19., 20.],
[21., 22., 23., 24.]]], device='cuda:0', dtype=torch.float64)
########## torch.float32/torch.int64/batch_shape=()/block_shape=() ##########
# sparse tensor
tensor(ccol_indices=tensor([0, 2, 4]),
row_indices=tensor([0, 1, 0, 2]),
values=tensor([1., 2., 3., 4.]), device='cuda:0', size=(3, 2), nnz=4,
layout=torch.sparse_csc)
# _ccol_indices
tensor([0, 2, 4], device='cuda:0')
# _row_indices
tensor([0, 1, 0, 2], device='cuda:0')
# _values
tensor([1., 2., 3., 4.], device='cuda:0')
########## torch.float32/torch.int64/batch_shape=()/block_shape=() ##########
# sparse tensor
tensor(ccol_indices=tensor([0]),
row_indices=tensor([], size=(0,)),
values=tensor([], size=(0,)), device='cuda:0', size=(0, 0), nnz=0,
layout=torch.sparse_csc)
# _ccol_indices
tensor([0], device='cuda:0')
# _row_indices
tensor([], device='cuda:0', dtype=torch.int64)
# _values
tensor([], device='cuda:0')
########## torch.float32/torch.int64/batch_shape=(2,)/block_shape=() ##########
# sparse tensor
tensor(ccol_indices=tensor([[0, 2, 4],
[0, 3, 4]]),
row_indices=tensor([[0, 1, 0, 1],
[0, 1, 2, 0]]),
values=tensor([[1., 2., 3., 4.],
[5., 6., 7., 8.]]), device='cuda:0', size=(2, 3, 2),
nnz=4, layout=torch.sparse_csc)
# _ccol_indices
tensor([[0, 2, 4],
[0, 3, 4]], device='cuda:0')
# _row_indices
tensor([[0, 1, 0, 1],
[0, 1, 2, 0]], device='cuda:0')
# _values
tensor([[1., 2., 3., 4.],
[5., 6., 7., 8.]], device='cuda:0')
########## torch.float32/torch.int64/batch_shape=(2, 3)/block_shape=() ##########
# sparse tensor
tensor(ccol_indices=tensor([[[0, 2, 4],
[0, 3, 4],
[0, 1, 4]],
[[0, 1, 4],
[0, 2, 4],
[0, 3, 4]]]),
row_indices=tensor([[[0, 1, 0, 1],
[0, 1, 2, 0],
[0, 0, 1, 2]],
[[1, 0, 1, 2],
[0, 2, 0, 1],
[0, 1, 2, 1]]]),
values=tensor([[[ 1., 2., 3., 4.],
[ 5., 6., 7., 8.],
[ 9., 10., 11., 12.]],
[[13., 14., 15., 16.],
[17., 18., 19., 20.],
[21., 22., 23., 24.]]]), device='cuda:0',
size=(2, 3, 3, 2), nnz=4, layout=torch.sparse_csc)
# _ccol_indices
tensor([[[0, 2, 4],
[0, 3, 4],
[0, 1, 4]],
[[0, 1, 4],
[0, 2, 4],
[0, 3, 4]]], device='cuda:0')
# _row_indices
tensor([[[0, 1, 0, 1],
[0, 1, 2, 0],
[0, 0, 1, 2]],
[[1, 0, 1, 2],
[0, 2, 0, 1],
[0, 1, 2, 1]]], device='cuda:0')
# _values
tensor([[[ 1., 2., 3., 4.],
[ 5., 6., 7., 8.],
[ 9., 10., 11., 12.]],
[[13., 14., 15., 16.],
[17., 18., 19., 20.],
[21., 22., 23., 24.]]], device='cuda:0')
########## torch.float64/torch.int64/batch_shape=()/block_shape=() ##########
# sparse tensor
tensor(ccol_indices=tensor([0, 2, 4]),
row_indices=tensor([0, 1, 0, 2]),
values=tensor([1., 2., 3., 4.]), device='cuda:0', size=(3, 2), nnz=4,
dtype=torch.float64, layout=torch.sparse_csc)
# _ccol_indices
tensor([0, 2, 4], device='cuda:0')
# _row_indices
tensor([0, 1, 0, 2], device='cuda:0')
# _values
tensor([1., 2., 3., 4.], device='cuda:0', dtype=torch.float64)
########## torch.float64/torch.int64/batch_shape=()/block_shape=() ##########
# sparse tensor
tensor(ccol_indices=tensor([0]),
row_indices=tensor([], size=(0,)),
values=tensor([], size=(0,)), device='cuda:0', size=(0, 0), nnz=0,
dtype=torch.float64, layout=torch.sparse_csc)
# _ccol_indices
tensor([0], device='cuda:0')
# _row_indices
tensor([], device='cuda:0', dtype=torch.int64)
# _values
tensor([], device='cuda:0', dtype=torch.float64)
########## torch.float64/torch.int64/batch_shape=(2,)/block_shape=() ##########
# sparse tensor
tensor(ccol_indices=tensor([[0, 2, 4],
[0, 3, 4]]),
row_indices=tensor([[0, 1, 0, 1],
[0, 1, 2, 0]]),
values=tensor([[1., 2., 3., 4.],
[5., 6., 7., 8.]]), device='cuda:0', size=(2, 3, 2),
nnz=4, dtype=torch.float64, layout=torch.sparse_csc)
# _ccol_indices
tensor([[0, 2, 4],
[0, 3, 4]], device='cuda:0')
# _row_indices
tensor([[0, 1, 0, 1],
[0, 1, 2, 0]], device='cuda:0')
# _values
tensor([[1., 2., 3., 4.],
[5., 6., 7., 8.]], device='cuda:0', dtype=torch.float64)
########## torch.float64/torch.int64/batch_shape=(2, 3)/block_shape=() ##########
# sparse tensor
tensor(ccol_indices=tensor([[[0, 2, 4],
[0, 3, 4],
[0, 1, 4]],
[[0, 1, 4],
[0, 2, 4],
[0, 3, 4]]]),
row_indices=tensor([[[0, 1, 0, 1],
[0, 1, 2, 0],
[0, 0, 1, 2]],
[[1, 0, 1, 2],
[0, 2, 0, 1],
[0, 1, 2, 1]]]),
values=tensor([[[ 1., 2., 3., 4.],
[ 5., 6., 7., 8.],
[ 9., 10., 11., 12.]],
[[13., 14., 15., 16.],
[17., 18., 19., 20.],
[21., 22., 23., 24.]]]), device='cuda:0',
size=(2, 3, 3, 2), nnz=4, dtype=torch.float64, layout=torch.sparse_csc)
# _ccol_indices
tensor([[[0, 2, 4],
[0, 3, 4],
[0, 1, 4]],
[[0, 1, 4],
[0, 2, 4],
[0, 3, 4]]], device='cuda:0')
# _row_indices
tensor([[[0, 1, 0, 1],
[0, 1, 2, 0],
[0, 0, 1, 2]],
[[1, 0, 1, 2],
[0, 2, 0, 1],
[0, 1, 2, 1]]], device='cuda:0')
# _values
tensor([[[ 1., 2., 3., 4.],
[ 5., 6., 7., 8.],
[ 9., 10., 11., 12.]],
[[13., 14., 15., 16.],
[17., 18., 19., 20.],
[21., 22., 23., 24.]]], device='cuda:0', dtype=torch.float64)