Home
last modified time | relevance | path

Searched refs:torch (Results 176 – 200 of 1822) sorted by relevance

12345678910>>...73

/dports/misc/ncnn/ncnn-20211208/tools/pnnx/tests/
H A Dtest_nn_PixelShuffle.py15 import torch
16 import torch.nn as nn
17 import torch.nn.functional as F
38 torch.manual_seed(0)
39 x = torch.rand(1, 128, 6, 8)
40 y = torch.rand(1, 12, 192, 7, 9)
45 mod = torch.jit.trace(net, (x, y))
56 return torch.equal(a0, b0) and torch.equal(a1, b1)
H A Dtest_F_upsample_nearest.py15 import torch
16 import torch.nn as nn
17 import torch.nn.functional as F
35 torch.manual_seed(0)
36 x = torch.rand(1, 12, 24, 64)
37 y = torch.rand(1, 4, 10, 24, 32)
42 mod = torch.jit.trace(net, (x, y))
53 return torch.equal(a0, b0) and torch.equal(a1, b1)
H A Dtest_nn_BatchNorm3d.py15 import torch
16 import torch.nn as nn
17 import torch.nn.functional as F
39 torch.manual_seed(0)
40 x = torch.rand(1, 32, 12, 5, 64)
41 y = torch.rand(1, 11, 3, 1, 1)
46 mod = torch.jit.trace(net, (x, y))
57 return torch.equal(a0, b0) and torch.equal(a1, b1)
H A Dtest_nn_BatchNorm1d.py15 import torch
16 import torch.nn as nn
17 import torch.nn.functional as F
39 torch.manual_seed(0)
40 x = torch.rand(1, 32, 64)
41 y = torch.rand(1, 11, 1)
46 mod = torch.jit.trace(net, (x, y))
57 return torch.equal(a0, b0) and torch.equal(a1, b1)
H A Dtest_Tensor_repeat.py15 import torch
16 import torch.nn as nn
17 import torch.nn.functional as F
36 torch.manual_seed(0)
37 x = torch.rand(1, 3, 16)
38 y = torch.rand(1, 5, 9, 11)
39 z = torch.rand(14, 8, 5, 9, 10)
44 mod = torch.jit.trace(net, (x, y, z))
56 if not torch.equal(a0, b0):
H A Dtest_Tensor_reshape.py15 import torch
16 import torch.nn as nn
17 import torch.nn.functional as F
36 torch.manual_seed(0)
37 x = torch.rand(1, 3, 16)
38 y = torch.rand(1, 5, 9, 11)
39 z = torch.rand(14, 8, 5, 9, 10)
44 mod = torch.jit.trace(net, (x, y, z))
56 if not torch.equal(a0, b0):
H A Dtest_Tensor_slice.py15 import torch
16 import torch.nn as nn
17 import torch.nn.functional as F
39 torch.manual_seed(0)
40 x = torch.rand(1, 13, 26)
41 y = torch.rand(1, 15, 19, 21)
42 z = torch.rand(14, 18, 15, 19, 20)
47 mod = torch.jit.trace(net, (x, y, z))
59 if not torch.equal(a0, b0):
H A Dtest_Tensor_view.py15 import torch
16 import torch.nn as nn
17 import torch.nn.functional as F
36 torch.manual_seed(0)
37 x = torch.rand(1, 3, 16)
38 y = torch.rand(1, 5, 9, 11)
39 z = torch.rand(14, 8, 5, 9, 10)
44 mod = torch.jit.trace(net, (x, y, z))
56 if not torch.equal(a0, b0):
H A Dtest_nn_BatchNorm2d.py15 import torch
16 import torch.nn as nn
17 import torch.nn.functional as F
39 torch.manual_seed(0)
40 x = torch.rand(1, 32, 12, 64)
41 y = torch.rand(1, 11, 1, 1)
46 mod = torch.jit.trace(net, (x, y))
57 return torch.equal(a0, b0) and torch.equal(a1, b1)
/dports/misc/ncnn/ncnn-20211208/tools/pnnx/tests/ncnn/
H A Dtest_F_hardsigmoid.py15 import torch
16 import torch.nn as nn
17 import torch.nn.functional as F
36 torch.manual_seed(0)
37 x = torch.rand(1, 16)
38 y = torch.rand(1, 2, 16)
39 z = torch.rand(1, 3, 12, 16)
44 mod = torch.jit.trace(net, (x, y, z))
56 if not torch.allclose(a0, b0, 1e-4, 1e-4):
H A Dtest_F_hardtanh.py15 import torch
16 import torch.nn as nn
17 import torch.nn.functional as F
33 torch.manual_seed(0)
34 x = torch.rand(1, 16)
35 y = torch.rand(1, 2, 16)
36 z = torch.rand(1, 3, 12, 16)
41 mod = torch.jit.trace(net, (x, y, z))
53 if not torch.allclose(a0, b0, 1e-4, 1e-4):
H A Dtest_F_sigmoid.py15 import torch
16 import torch.nn as nn
17 import torch.nn.functional as F
33 torch.manual_seed(0)
34 x = torch.rand(1, 16)
35 y = torch.rand(1, 2, 16)
36 z = torch.rand(1, 3, 12, 16)
41 mod = torch.jit.trace(net, (x, y, z))
53 if not torch.allclose(a0, b0, 1e-4, 1e-4):
H A Dtest_F_tanh.py15 import torch
16 import torch.nn as nn
17 import torch.nn.functional as F
33 torch.manual_seed(0)
34 x = torch.rand(1, 16)
35 y = torch.rand(1, 2, 16)
36 z = torch.rand(1, 3, 12, 16)
41 mod = torch.jit.trace(net, (x, y, z))
53 if not torch.allclose(a0, b0, 1e-4, 1e-4):
H A Dtest_nn_Hardsigmoid.py15 import torch
16 import torch.nn as nn
17 import torch.nn.functional as F
35 torch.manual_seed(0)
36 x = torch.rand(1, 12)
37 y = torch.rand(1, 12, 64)
38 z = torch.rand(1, 12, 24, 64)
43 mod = torch.jit.trace(net, (x, y, z))
55 if not torch.allclose(a0, b0, 1e-4, 1e-4):
H A Dtest_Tensor_slice.py15 import torch
16 import torch.nn as nn
17 import torch.nn.functional as F
39 torch.manual_seed(0)
40 x = torch.rand(1, 13, 26)
41 y = torch.rand(1, 15, 19, 21)
42 z = torch.rand(1, 18, 15, 19, 20)
47 mod = torch.jit.trace(net, (x, y, z))
59 if not torch.allclose(a0, b0, 1e-4, 1e-4):
H A Dtest_Tensor_view.py15 import torch
16 import torch.nn as nn
17 import torch.nn.functional as F
36 torch.manual_seed(0)
37 x = torch.rand(1, 3, 16)
38 y = torch.rand(1, 5, 9, 11)
39 z = torch.rand(1, 8, 5, 9, 2)
44 mod = torch.jit.trace(net, (x, y, z))
56 if not torch.allclose(a0, b0, 1e-4, 1e-4):
H A Dtest_nn_ELU.py15 import torch
16 import torch.nn as nn
17 import torch.nn.functional as F
36 torch.manual_seed(0)
37 x = torch.rand(1, 12)
38 y = torch.rand(1, 12, 64)
39 z = torch.rand(1, 12, 24, 64)
44 mod = torch.jit.trace(net, (x, y, z))
56 if not torch.allclose(a0, b0, 1e-4, 1e-4):
H A Dtest_nn_BatchNorm1d.py15 import torch
16 import torch.nn as nn
17 import torch.nn.functional as F
39 torch.manual_seed(0)
40 x = torch.rand(1, 32, 64)
41 y = torch.rand(1, 11, 1)
46 mod = torch.jit.trace(net, (x, y))
57 return torch.allclose(a0, b0, 1e-4, 1e-4) and torch.allclose(a1, b1, 1e-4, 1e-4)
H A Dtest_nn_BatchNorm2d.py15 import torch
16 import torch.nn as nn
17 import torch.nn.functional as F
39 torch.manual_seed(0)
40 x = torch.rand(1, 32, 12, 64)
41 y = torch.rand(1, 11, 1, 1)
46 mod = torch.jit.trace(net, (x, y))
57 return torch.allclose(a0, b0, 1e-4, 1e-4) and torch.allclose(a1, b1, 1e-4, 1e-4)
H A Dtest_nn_Hardtanh.py15 import torch
16 import torch.nn as nn
17 import torch.nn.functional as F
36 torch.manual_seed(0)
37 x = torch.rand(1, 12)
38 y = torch.rand(1, 12, 64)
39 z = torch.rand(1, 12, 24, 64)
44 mod = torch.jit.trace(net, (x, y, z))
56 if not torch.allclose(a0, b0, 1e-4, 1e-4):
H A Dtest_nn_Linear.py15 import torch
16 import torch.nn as nn
17 import torch.nn.functional as F
39 torch.manual_seed(0)
40 x = torch.rand(1, 64)
41 y = torch.rand(1, 12, 64)
46 mod = torch.jit.trace(net, (x, y))
57 return torch.allclose(a0, b0, 1e-4, 1e-4) and torch.allclose(a1, b1, 1e-4, 1e-4)
H A Dtest_Tensor_reshape.py15 import torch
16 import torch.nn as nn
17 import torch.nn.functional as F
36 torch.manual_seed(0)
37 x = torch.rand(1, 3, 16)
38 y = torch.rand(1, 5, 9, 11)
39 z = torch.rand(1, 8, 5, 9, 2)
44 mod = torch.jit.trace(net, (x, y, z))
56 if not torch.allclose(a0, b0, 1e-4, 1e-4):
H A Dtest_nn_BatchNorm3d.py15 import torch
16 import torch.nn as nn
17 import torch.nn.functional as F
39 torch.manual_seed(0)
40 x = torch.rand(1, 32, 12, 5, 64)
41 y = torch.rand(1, 11, 3, 1, 1)
46 mod = torch.jit.trace(net, (x, y))
57 return torch.allclose(a0, b0, 1e-4, 1e-4) and torch.allclose(a1, b1, 1e-4, 1e-4)
/dports/misc/glow/glow-f24d960e3cc80db95ac0bc17b1900dbf60ca044a/torch_glow/tests/functionality/
H A Dto_glow_selective_test.py4 import torch
8 class Qux(torch.nn.Module):
17 class Baz(torch.nn.Module):
26 class Bar(torch.nn.Module):
35 class Foo(torch.nn.Module):
45 class Model(torch.nn.Module):
72 a = torch.zeros(4) + 8
73 b = torch.zeros(4) + 7
76 spec = torch.classes.glow.GlowCompileSpec()
78 sim = torch.classes.glow.SpecInputMeta()
[all …]
/dports/math/py-pytorchvideo/pytorchvideo-0.1.3/pytorchvideo/models/
H A Dbyol.py6 import torch
7 import torch.nn as nn
8 import torch.nn.functional as F
45 torch._C._log_api_usage_once("PYTORCHVIDEO.model.BYOL.__init__")
75 similarity = torch.einsum("nc,nc->n", [q, k])
93 @torch.no_grad()
103 @torch.no_grad()
110 with torch.no_grad():
124 def forward(self, x1: torch.Tensor, x2: torch.Tensor) -> torch.Tensor:
135 with torch.no_grad():

12345678910>>...73