Home
last modified time | relevance | path

Searched refs:torch (Results 1 – 25 of 1566) sorted by relevance

12345678910>>...63

/dports/misc/mxnet/incubator-mxnet-1.9.0/3rdparty/tvm/tests/python/frontend/pytorch/
H A Dtest_forward.py24 import torch
510 end = torch.add(torch.tensor(4), 1)
511 return torch.arange(end) + torch.ones((5,), dtype=torch.int64)
515 end = torch.add(torch.tensor(4.0), torch.tensor(1.0))
516 return torch.arange(end) + torch.ones((5,), dtype=torch.float)
521 end = torch.add(torch.tensor(4), 1)
530 step = torch.add(torch.tensor(2.5), torch.tensor(4.1))
562 y = torch.add(torch.tensor(5, dtype=torch.float32), 1)
1130 d1 = torch.tensor(3) * torch.tensor(10) * torch.tensor(10)
2959 for dt in [torch.int32, torch.int64, torch.double]:
[all …]
/dports/misc/glow/glow-f24d960e3cc80db95ac0bc17b1900dbf60ca044a/torch_glow/tests/nodes/
H A Dquantized_conv2d_test.py5 import torch
14 qu = torch.nn.quantized.Quantize(1 / 16, 0, torch.quint8)
15 qi = torch.nn.quantized.Quantize(1 / 16, 0, torch.qint8)
30 b_zero = torch.zeros(1)
31 b = torch.randn(1)
60 x = torch.tensor(range(5), dtype=torch.float)
64 q = torch.nn.quantized.Quantize(0.1, 2, torch.quint8)
93 x = torch.tensor(range(5), dtype=torch.float)
97 q = torch.nn.quantized.Quantize(0.1, 2, torch.quint8)
128 with torch.no_grad():
[all …]
H A Dquantized_conv3d_test.py5 import torch
19 qu = torch.nn.quantized.Quantize(1 / 16, 0, torch.quint8)
20 qi = torch.nn.quantized.Quantize(1 / 16, 0, torch.qint8)
35 b_zero = torch.zeros(1)
36 b = torch.randn(1)
65 x = torch.tensor(range(5), dtype=torch.float)
67 x = torch.cat((x, x, x))
70 q = torch.nn.quantized.Quantize(0.1, 2, torch.quint8)
99 x = torch.tensor(range(5), dtype=torch.float)
104 q = torch.nn.quantized.Quantize(0.1, 2, torch.quint8)
[all …]
H A Dquantized_linear_test.py3 import torch
13 q = torch.nn.quantized.Quantize(
17 linear = torch.nn.Linear(5, 5)
27 x = torch.tensor(range(5), dtype=torch.float)
28 x = torch.cat((x, x, x, x, x))
29 x = torch.reshape(x, [5, 5])
48 linear = torch.nn.Linear(5, 5)
58 x = torch.tensor(range(5), dtype=torch.float)
60 x = torch.reshape(x, [5, 5])
97 bias = torch.tensor([1, 1, 1, 1, 1, 1, 1], dtype=torch.float) * 0.1
[all …]
H A Dquantized_conv3d_relu_test.py6 import torch
13 with torch.no_grad():
14 x = torch.tensor(range(5), dtype=torch.float)
16 x = torch.cat((x, x, x))
19 q = torch.nn.quantized.Quantize(1, 2, torch.quint8)
22 relu = torch.nn.ReLU()
28 torch.arange(72 / groups, dtype=torch.float).reshape(
75 with torch.no_grad():
76 x = torch.tensor(range(5), dtype=torch.float)
81 q = torch.nn.quantized.Quantize(1, 2, torch.quint8)
[all …]
H A Dquantized_conv2d_relu_test.py3 import torch
13 with torch.no_grad():
14 x = torch.tensor(range(5), dtype=torch.float) / 3
16 x = torch.cat((x, x, x))
18 q = torch.nn.quantized.Quantize(1, 2, torch.quint8)
20 relu = torch.nn.ReLU()
25 conv.weight.set_(torch.arange(36/groups, dtype=torch.float).reshape([3,
67 with torch.no_grad():
68 x = torch.tensor(range(5), dtype=torch.float) / 3
72 q = torch.nn.quantized.Quantize(1, 2, torch.quint8)
[all …]
H A Dquantized_add_relu_test.py3 import torch
14 q = torch.nn.quantized.Quantize(
18 torch.ops.quantized.add_relu(
22 x = torch.tensor([1, 2, 3, 4], dtype=torch.float32)
23 y = torch.tensor([5, 6, 7, 8], dtype=torch.float32)
40 q1 = torch.nn.quantized.Quantize(
43 q2 = torch.nn.quantized.Quantize(
53 x = torch.randn([5, 5])
54 y = torch.randn([5, 5])
84 x = torch.randn([5, 5])
[all …]
H A Dquantized_add_test.py3 import torch
14 q = torch.nn.quantized.Quantize(
19 x = torch.tensor([1, 2, 3, 4], dtype=torch.float32)
20 y = torch.tensor([5, 6, 7, 8], dtype=torch.float32)
37 q1 = torch.nn.quantized.Quantize(
45 torch.ops.quantized.add(
49 x = torch.randn([5, 5])
50 y = torch.randn([5, 5])
75 torch.ops.quantized.add(
79 x = torch.randn([5, 5])
[all …]
H A Drsub_test.py3 import torch
14 c = torch.rsub(a, b)
15 return torch.rsub(c, c)
17 x = torch.randn(4)
18 y = torch.randn(4)
26 c = torch.rsub(a, b)
30 y = torch.randn(4, 2)
42 y = torch.randn(1, 2)
53 x = torch.randn(4, 2)
64 x = torch.randn(4)
[all …]
/dports/misc/glow/glow-f24d960e3cc80db95ac0bc17b1900dbf60ca044a/torch_glow/src/
H A DPyTorchModelLoader.h109 const at::ArrayRef<torch::jit::IValue> inputs_;
115 std::unordered_map<const torch::jit::Value *, torch::jit::IValue> qparamsMap_;
410 Error loadMul(const torch::jit::Node *ptNode);
414 Error loadDiv(const torch::jit::Node *ptNode);
418 Error loadAdd(const torch::jit::Node *ptNode);
422 Error loadSub(const torch::jit::Node *ptNode);
430 Error loadMax(const torch::jit::Node *ptNode);
446 Error loadExp(const torch::jit::Node *ptNode);
553 Error loadT(const torch::jit::Node *ptNode);
613 Error loadMM(const torch::jit::Node *ptNode);
[all …]
H A DGlowFuser.cpp37 torch::jit::value_list
40 torch::jit::value_list result; in sortReverseTopological()
48 [&](torch::jit::Value *a, torch::jit::Value *b) { in sortReverseTopological()
98 bool aliasChecks(torch::jit::Node *consumer, torch::jit::Node *producer, in aliasChecks()
118 torch::jit::Node *tryMerge(torch::jit::Node *consumer, in tryMerge()
149 producer, [](torch::jit::Value *) -> torch::jit::Value * { in tryMerge()
168 std::shared_ptr<torch::jit::Graph> getSubgraph(torch::jit::Node *n) { in getSubgraph()
172 const std::shared_ptr<torch::jit::Graph>
173 getSubgraph(const torch::jit::Node *n) { in getSubgraph()
178 getNewNode(torch::jit::Node *node, torch::jit::AliasDb &aliasDb, in getNewNode()
[all …]
H A DFuseKnownPatterns.cpp35 torch::jit::RegisterOperators op({torch::jit::Operator( in registerDummyOperator()
37 [](const torch::jit::Node *node) -> torch::jit::Operation { in registerDummyOperator()
113 torch::jit::SubgraphRewriter rewriter; in fuseLinearPrepack()
129 torch::jit::SubgraphRewriter rewriter; in fuseNumToTensorToNum()
163 fusedNode->i_(torch::jit::attr::dim, dim); in fuseConcat()
207 torch::jit::Value *inputValue = nullptr; in fuseBranchedLinearPattern()
208 torch::jit::Value *cValue = nullptr; in fuseBranchedLinearPattern()
209 torch::jit::Value *weightValue = nullptr; in fuseBranchedLinearPattern()
210 torch::jit::Value *biasValue = nullptr; in fuseBranchedLinearPattern()
211 torch::jit::Value *dValue = nullptr; in fuseBranchedLinearPattern()
[all …]
/dports/math/faiss/faiss-1.7.1/faiss/gpu/test/
H A Dtorch_test_contrib_gpu.py7 import torch
32 xb_torch_gpu = torch.rand(10000, 128, device=torch.device('cuda', 0), dtype=torch.float32)
57 new_i_torch_gpu = torch.zeros(10, 10, device=torch.device('cuda', 0), dtype=torch.int64)
80 xb = torch.rand(1000, d, device=torch.device('cuda', 0), dtype=torch.float32)
117 xb = torch.rand(100, d, device=torch.device('cuda', 0), dtype=torch.float32)
131 y = torch.empty(d, dtype=torch.float32)
136 y = torch.empty(d, device=torch.device('cuda', 0), dtype=torch.float32)
151 y = torch.empty(10, d, dtype=torch.float32)
156 y = torch.empty(10, d, device=torch.device('cuda', 0), dtype=torch.float32)
167 xb = torch.rand(10000, d, device=torch.device('cuda', 0), dtype=torch.float32)
[all …]
/dports/math/faiss/faiss-1.7.1/tests/
H A Dtorch_test_contrib.py7 import torch
36 xq_torch = torch.rand(10, d, dtype=torch.float32)
69 xb = torch.rand(1000, d, dtype=torch.float32)
90 xb = torch.rand(100, d, dtype=torch.float32)
103 y = torch.empty(d, dtype=torch.float32)
117 y = torch.empty(10, d, dtype=torch.float32)
125 xb = torch.rand(1000, d, dtype=torch.float32)
132 xq = torch.rand(10, d, dtype=torch.float32)
212 xq = torch.rand(10, d, dtype=torch.float32)
230 xq = torch.rand(10, d, dtype=torch.float32)
[all …]
/dports/math/py-pytorchvideo/pytorchvideo-0.1.3/pytorchvideo/transforms/
H A Dtransforms.py6 import torch
29 def __call__(self, x: Dict[str, torch.Tensor]) -> Dict[str, torch.Tensor]:
62 def forward(self, x: torch.Tensor) -> torch.Tensor:
101 def forward(self, x: torch.Tensor) -> torch.Tensor:
120 def forward(self, x: torch.Tensor) -> torch.Tensor:
163 def forward(self, x: torch.Tensor) -> torch.Tensor:
179 def forward(self, x: torch.Tensor) -> torch.Tensor:
215 def __call__(self, x: torch.Tensor) -> torch.Tensor:
250 def forward(self, x: torch.Tensor) -> torch.Tensor:
311 def forward(self, x: torch.Tensor) -> torch.Tensor:
[all …]
H A Dfunctional.py8 import torch
21 ) -> torch.Tensor:
44 @torch.jit.ignore
47 ) -> torch.Tensor:
97 ) -> torch.Tensor:
240 ) -> Tuple[torch.Tensor, torch.Tensor]:
268 images: torch.Tensor, size: int, boxes: torch.Tensor
269 ) -> Tuple[torch.Tensor, torch.Tensor]:
381 prob: float, images: torch.Tensor, boxes: torch.Tensor
382 ) -> Tuple[torch.Tensor, torch.Tensor]:
[all …]
/dports/math/py-fvcore/fvcore-0.1.5.post20210924/fvcore/nn/
H A Ddistributed.py3 import torch
4 import torch.distributed as dist
5 from torch.autograd.function import Function
13 def forward(ctx, input: torch.Tensor) -> torch.Tensor:
18 return torch.sum(inputs, dim=0)
21 def backward(ctx, grad_output: torch.Tensor) -> torch.Tensor:
26 def differentiable_all_reduce(input: torch.Tensor) -> torch.Tensor:
41 def forward(ctx, x: torch.Tensor) -> Tuple[torch.Tensor, ...]:
47 def backward(ctx, *grads: torch.Tensor) -> torch.Tensor:
48 all_gradients = torch.stack(grads)
[all …]
H A Dprecise_bn.py8 import torch
10 from torch import nn
14 torch.nn.BatchNorm1d,
15 torch.nn.BatchNorm2d,
16 torch.nn.BatchNorm3d,
17 torch.nn.SyncBatchNorm,
39 self.pop_mean: torch.Tensor = torch.zeros_like(mean_buffer)
40 self.pop_var: torch.Tensor = torch.zeros_like(var_buffer)
44 self, batch_mean: torch.Tensor, batch_var: torch.Tensor, batch_size: int
66 self.pop_mean: torch.Tensor = torch.zeros_like(mean_buffer)
[all …]
/dports/misc/ncnn/ncnn-20211208/tools/pnnx/tests/
H A Dtest_F_batch_norm.py15 import torch
16 import torch.nn as nn
46 m1 = torch.rand(2)
47 v1 = torch.rand(2)
48 w1 = torch.rand(2)
49 b1 = torch.rand(2)
50 m2 = torch.rand(3)
51 v2 = torch.rand(3)
52 w2 = torch.rand(3)
53 b2 = torch.rand(3)
[all …]
H A Dtest_F_instance_norm.py15 import torch
16 import torch.nn as nn
42 m0 = torch.rand(12)
43 v0 = torch.rand(12)
44 w0 = torch.rand(12)
45 b0 = torch.rand(12)
46 m1 = torch.rand(3)
47 v1 = torch.rand(3)
48 w1 = torch.rand(3)
49 b1 = torch.rand(3)
[all …]
/dports/games/supertux2/SuperTux-v0.6.3-Source/data/levels/halloween2014/
H A Dhalloween1.stl684 (torch
688 (torch
693 (torch
698 (torch
703 (torch
708 (torch
713 (torch
718 (torch
723 (torch
728 (torch
[all …]
H A Dmound.stl634 (torch
638 (torch
643 (torch
648 (torch
653 (torch
658 (torch
662 (torch
667 (torch
671 (torch
676 (torch
[all …]
/dports/math/faiss/faiss-1.7.1/contrib/
H A Dtorch_utils.py25 import torch
166 labels = torch.empty(n, k, device=x.device, dtype=torch.int64)
215 D = torch.empty(n, k, device=x.device, dtype=torch.float32)
222 I = torch.empty(n, k, device=x.device, dtype=torch.int64)
251 D = torch.empty(n, k, device=x.device, dtype=torch.float32)
258 I = torch.empty(n, k, device=x.device, dtype=torch.int64)
304 x = torch.empty(self.d, device=device, dtype=torch.float32)
447 x = torch.empty(n, self.d, dtype=torch.float32)
536 D = torch.empty(nq, k, device=xb.device, dtype=torch.float32)
543 I = torch.empty(nq, k, device=xb.device, dtype=torch.int64)
[all …]
/dports/misc/glow/glow-f24d960e3cc80db95ac0bc17b1900dbf60ca044a/torch_glow/tests/functionality/
H A Dconv_to_glow_test.py4 import torch
13 with torch.no_grad():
18 conv_op = torch.nn.Conv2d(3, 10, 3)
20 conv_op = torch.nn.Conv3d(3, 10, 3)
30 model = torch.nn.Sequential(
49 traced_m = torch.jit.trace(m, (x))
54 sim.set(x.size(), torch.float32)
64 x = torch.randn([1, 3, 30, 30])
69 x = torch.randn([1, 3, 30, 30])
74 x = torch.randn([1, 3, 30, 30, 30])
[all …]
/dports/science/py-kliff/kliff-0.3.0/kliff/models/
H A Dlinear_regression.py1 import torch
2 import torch.nn as nn
6 from torch.utils.data import DataLoader
32 A = torch.inverse(torch.mm(X.t(), X))
33 beta = torch.mv(torch.mm(A, X.t()), y)
50 self.layer.bias = torch.nn.Parameter(beta[0:1])
77 x_ = torch.cat((zeta, torch.transpose(dzeta)))
78 y_ = torch.cat((e, f))
83 x_ = torch.transpose(dzeta)
93 X = torch.cat(X)
[all …]

12345678910>>...63