• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# shape: torch.Size([])
2# nnz: 2
3# sparse_dim: 0
4# indices shape: torch.Size([0, 2])
5# values shape: torch.Size([2])
6########## torch.int32 ##########
7# sparse tensor
8tensor(indices=tensor([], size=(0, 2)),
9       values=tensor([0, 1]),
10       size=(), nnz=2, dtype=torch.int32, layout=torch.sparse_coo)
11# _indices
12tensor([], size=(0, 2), dtype=torch.int64)
13# _values
14tensor([0, 1], dtype=torch.int32)
15########## torch.float32 ##########
16# sparse tensor
17tensor(indices=tensor([], size=(0, 2)),
18       values=tensor([0., 1.]),
19       size=(), nnz=2, layout=torch.sparse_coo)
20# after requires_grad_
21tensor(indices=tensor([], size=(0, 2)),
22       values=tensor([0., 1.]),
23       size=(), nnz=2, layout=torch.sparse_coo, requires_grad=True)
24# after addition
25tensor(indices=tensor([], size=(0, 2)),
26       values=tensor([0., 2.]),
27       size=(), nnz=2, layout=torch.sparse_coo, grad_fn=<AddBackward0>)
28# _indices
29tensor([], size=(0, 2), dtype=torch.int64)
30# _values
31tensor([0., 1.])
32
33# shape: torch.Size([0])
34# nnz: 10
35# sparse_dim: 0
36# indices shape: torch.Size([0, 10])
37# values shape: torch.Size([10, 0])
38########## torch.int32 ##########
39# sparse tensor
40tensor(indices=tensor([], size=(0, 10)),
41       values=tensor([], size=(10, 0)),
42       size=(0,), nnz=10, dtype=torch.int32, layout=torch.sparse_coo)
43# _indices
44tensor([], size=(0, 10), dtype=torch.int64)
45# _values
46tensor([], size=(10, 0), dtype=torch.int32)
47########## torch.float64 ##########
48# sparse tensor
49tensor(indices=tensor([], size=(0, 10)),
50       values=tensor([], size=(10, 0)),
51       size=(0,), nnz=10, dtype=torch.float64, layout=torch.sparse_coo)
52# after requires_grad_
53tensor(indices=tensor([], size=(0, 10)),
54       values=tensor([], size=(10, 0)),
55       size=(0,), nnz=10, dtype=torch.float64, layout=torch.sparse_coo,
56       requires_grad=True)
57# after addition
58tensor(indices=tensor([], size=(0, 10)),
59       values=tensor([], size=(10, 0)),
60       size=(0,), nnz=10, dtype=torch.float64, layout=torch.sparse_coo,
61       grad_fn=<AddBackward0>)
62# _indices
63tensor([], size=(0, 10), dtype=torch.int64)
64# _values
65tensor([], size=(10, 0), dtype=torch.float64)
66
67# shape: torch.Size([2])
68# nnz: 3
69# sparse_dim: 0
70# indices shape: torch.Size([0, 3])
71# values shape: torch.Size([3, 2])
72########## torch.int32 ##########
73# sparse tensor
74tensor(indices=tensor([], size=(0, 3)),
75       values=tensor([[0, 0],
76                      [0, 1],
77                      [1, 1]]),
78       size=(2,), nnz=3, dtype=torch.int32, layout=torch.sparse_coo)
79# _indices
80tensor([], size=(0, 3), dtype=torch.int64)
81# _values
82tensor([[0, 0],
83        [0, 1],
84        [1, 1]], dtype=torch.int32)
85########## torch.float32 ##########
86# sparse tensor
87tensor(indices=tensor([], size=(0, 3)),
88       values=tensor([[0.0000, 0.3333],
89                      [0.6667, 1.0000],
90                      [1.3333, 1.6667]]),
91       size=(2,), nnz=3, layout=torch.sparse_coo)
92# after requires_grad_
93tensor(indices=tensor([], size=(0, 3)),
94       values=tensor([[0.0000, 0.3333],
95                      [0.6667, 1.0000],
96                      [1.3333, 1.6667]]),
97       size=(2,), nnz=3, layout=torch.sparse_coo, requires_grad=True)
98# after addition
99tensor(indices=tensor([], size=(0, 3)),
100       values=tensor([[0.0000, 0.6667],
101                      [1.3333, 2.0000],
102                      [2.6667, 3.3333]]),
103       size=(2,), nnz=3, layout=torch.sparse_coo, grad_fn=<AddBackward0>)
104# _indices
105tensor([], size=(0, 3), dtype=torch.int64)
106# _values
107tensor([[0.0000, 0.3333],
108        [0.6667, 1.0000],
109        [1.3333, 1.6667]])
110
111# shape: torch.Size([100, 3])
112# nnz: 3
113# sparse_dim: 1
114# indices shape: torch.Size([1, 3])
115# values shape: torch.Size([3, 3])
116########## torch.int32 ##########
117# sparse tensor
118tensor(indices=tensor([[0, 1, 2]]),
119       values=tensor([[0, 0, 0],
120                      [0, 0, 1],
121                      [1, 1, 1]]),
122       size=(100, 3), nnz=3, dtype=torch.int32, layout=torch.sparse_coo)
123# _indices
124tensor([[0, 1, 2]])
125# _values
126tensor([[0, 0, 0],
127        [0, 0, 1],
128        [1, 1, 1]], dtype=torch.int32)
129########## torch.float64 ##########
130# sparse tensor
131tensor(indices=tensor([[0, 1, 2]]),
132       values=tensor([[0.0000, 0.2222, 0.4444],
133                      [0.6667, 0.8889, 1.1111],
134                      [1.3333, 1.5556, 1.7778]]),
135       size=(100, 3), nnz=3, dtype=torch.float64, layout=torch.sparse_coo)
136# after requires_grad_
137tensor(indices=tensor([[0, 1, 2]]),
138       values=tensor([[0.0000, 0.2222, 0.4444],
139                      [0.6667, 0.8889, 1.1111],
140                      [1.3333, 1.5556, 1.7778]]),
141       size=(100, 3), nnz=3, dtype=torch.float64, layout=torch.sparse_coo,
142       requires_grad=True)
143# after addition
144tensor(indices=tensor([[0, 1, 2]]),
145       values=tensor([[0.0000, 0.4444, 0.8889],
146                      [1.3333, 1.7778, 2.2222],
147                      [2.6667, 3.1111, 3.5556]]),
148       size=(100, 3), nnz=3, dtype=torch.float64, layout=torch.sparse_coo,
149       grad_fn=<AddBackward0>)
150# _indices
151tensor([[0, 1, 2]])
152# _values
153tensor([[0.0000, 0.2222, 0.4444],
154        [0.6667, 0.8889, 1.1111],
155        [1.3333, 1.5556, 1.7778]], dtype=torch.float64)
156
157# shape: torch.Size([100, 20, 3])
158# nnz: 0
159# sparse_dim: 2
160# indices shape: torch.Size([2, 0])
161# values shape: torch.Size([0, 3])
162########## torch.int32 ##########
163# sparse tensor
164tensor(indices=tensor([], size=(2, 0)),
165       values=tensor([], size=(0, 3)),
166       size=(100, 20, 3), nnz=0, dtype=torch.int32, layout=torch.sparse_coo)
167# _indices
168tensor([], size=(2, 0), dtype=torch.int64)
169# _values
170tensor([], size=(0, 3), dtype=torch.int32)
171########## torch.float32 ##########
172# sparse tensor
173tensor(indices=tensor([], size=(2, 0)),
174       values=tensor([], size=(0, 3)),
175       size=(100, 20, 3), nnz=0, layout=torch.sparse_coo)
176# after requires_grad_
177tensor(indices=tensor([], size=(2, 0)),
178       values=tensor([], size=(0, 3)),
179       size=(100, 20, 3), nnz=0, layout=torch.sparse_coo, requires_grad=True)
180# after addition
181tensor(indices=tensor([], size=(2, 0)),
182       values=tensor([], size=(0, 3)),
183       size=(100, 20, 3), nnz=0, layout=torch.sparse_coo, grad_fn=<AddBackward0>)
184# _indices
185tensor([], size=(2, 0), dtype=torch.int64)
186# _values
187tensor([], size=(0, 3))
188
189# shape: torch.Size([10, 0, 3])
190# nnz: 3
191# sparse_dim: 0
192# indices shape: torch.Size([0, 3])
193# values shape: torch.Size([3, 10, 0, 3])
194########## torch.int32 ##########
195# sparse tensor
196tensor(indices=tensor([], size=(0, 3)),
197       values=tensor([], size=(3, 10, 0, 3)),
198       size=(10, 0, 3), nnz=3, dtype=torch.int32, layout=torch.sparse_coo)
199# _indices
200tensor([], size=(0, 3), dtype=torch.int64)
201# _values
202tensor([], size=(3, 10, 0, 3), dtype=torch.int32)
203########## torch.float64 ##########
204# sparse tensor
205tensor(indices=tensor([], size=(0, 3)),
206       values=tensor([], size=(3, 10, 0, 3)),
207       size=(10, 0, 3), nnz=3, dtype=torch.float64, layout=torch.sparse_coo)
208# after requires_grad_
209tensor(indices=tensor([], size=(0, 3)),
210       values=tensor([], size=(3, 10, 0, 3)),
211       size=(10, 0, 3), nnz=3, dtype=torch.float64, layout=torch.sparse_coo,
212       requires_grad=True)
213# after addition
214tensor(indices=tensor([], size=(0, 3)),
215       values=tensor([], size=(3, 10, 0, 3)),
216       size=(10, 0, 3), nnz=3, dtype=torch.float64, layout=torch.sparse_coo,
217       grad_fn=<AddBackward0>)
218# _indices
219tensor([], size=(0, 3), dtype=torch.int64)
220# _values
221tensor([], size=(3, 10, 0, 3), dtype=torch.float64)
222
223# shape: torch.Size([10, 0, 3])
224# nnz: 0
225# sparse_dim: 0
226# indices shape: torch.Size([0, 0])
227# values shape: torch.Size([0, 10, 0, 3])
228########## torch.int32 ##########
229# sparse tensor
230tensor(indices=tensor([], size=(0, 0)),
231       values=tensor([], size=(0, 10, 0, 3)),
232       size=(10, 0, 3), nnz=0, dtype=torch.int32, layout=torch.sparse_coo)
233# _indices
234tensor([], size=(0, 0), dtype=torch.int64)
235# _values
236tensor([], size=(0, 10, 0, 3), dtype=torch.int32)
237########## torch.float32 ##########
238# sparse tensor
239tensor(indices=tensor([], size=(0, 0)),
240       values=tensor([], size=(0, 10, 0, 3)),
241       size=(10, 0, 3), nnz=0, layout=torch.sparse_coo)
242# after requires_grad_
243tensor(indices=tensor([], size=(0, 0)),
244       values=tensor([], size=(0, 10, 0, 3)),
245       size=(10, 0, 3), nnz=0, layout=torch.sparse_coo, requires_grad=True)
246# after addition
247tensor(indices=tensor([], size=(0, 0)),
248       values=tensor([], size=(0, 10, 0, 3)),
249       size=(10, 0, 3), nnz=0, layout=torch.sparse_coo, grad_fn=<AddBackward0>)
250# _indices
251tensor([], size=(0, 0), dtype=torch.int64)
252# _values
253tensor([], size=(0, 10, 0, 3))
254