/dports/misc/ncnn/ncnn-20211208/tools/pnnx/tests/ |
H A D | test_nn_PixelShuffle.py | 15 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 D | test_F_upsample_nearest.py | 15 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 D | test_nn_BatchNorm3d.py | 15 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 D | test_nn_BatchNorm1d.py | 15 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 D | test_Tensor_repeat.py | 15 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 D | test_Tensor_reshape.py | 15 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 D | test_Tensor_slice.py | 15 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 D | test_Tensor_view.py | 15 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 D | test_nn_BatchNorm2d.py | 15 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 D | test_F_hardsigmoid.py | 15 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 D | test_F_hardtanh.py | 15 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 D | test_F_sigmoid.py | 15 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 D | test_F_tanh.py | 15 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 D | test_nn_Hardsigmoid.py | 15 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 D | test_Tensor_slice.py | 15 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 D | test_Tensor_view.py | 15 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 D | test_nn_ELU.py | 15 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 D | test_nn_BatchNorm1d.py | 15 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 D | test_nn_BatchNorm2d.py | 15 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 D | test_nn_Hardtanh.py | 15 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 D | test_nn_Linear.py | 15 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 D | test_Tensor_reshape.py | 15 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 D | test_nn_BatchNorm3d.py | 15 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 D | to_glow_selective_test.py | 4 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 D | byol.py | 6 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():
|