mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
25 lines
217 B
Python
25 lines
217 B
Python
import torch
|
|
|
|
a = torch.FloatTensor(4, 3)
|
|
b = torch.FloatTensor(3, 4)
|
|
|
|
a.add(b)
|
|
|
|
c = a.storage()
|
|
|
|
d = a.select(0, 1)
|
|
|
|
print(c)
|
|
print(a)
|
|
print(b)
|
|
print(d)
|
|
|
|
|
|
a.fill(0)
|
|
|
|
print(a[1])
|
|
|
|
print(a.ge(long(0)))
|
|
print(a.ge(0))
|
|
|