Pytorch Added

This commit is contained in:
e2hang
2025-09-09 15:10:57 +08:00
parent a74884a555
commit a5fdeaf70e
20 changed files with 1307 additions and 2 deletions

View File

@@ -0,0 +1,29 @@
import torch
a = torch.tensor(([[[[0., 0., 0.],
[0., 0., 0.]],
[[0., 1., 0.],
[0., 0., 0.]]],
[[[0., 2., 0.],
[0., 0., 0.]],
[[0., 3., 0.],
[0., 0., 0.]]]]))
print(a)
b = torch.tensor([[3., 2., 1.], [1., 2., 3.]])
c = torch.tensor([[1., 2., 3.], [4., 5., 6.]])
print(b)
times = b * c
print(times)
print(times.type())
c = torch.normal(mean=1.0, std=torch.rand(5, 5))
print(c)
d = torch.randperm(10)
print(d)