-
Notifications
You must be signed in to change notification settings - Fork 2
/
q_test.py
49 lines (36 loc) · 998 Bytes
/
q_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from operator import concat
import wandb
import os
import shutil
import time
import logging
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torchvision.transforms as transforms
import torchvision.datasets as datasets
from torchsummary import summary
from src.model_analysis.utils import same_output
from src.model_analysis.visualize import simulate_input
# model = resmlp_24(pretrained=True)
# qmodel = q_test(model)
# set_training(qmodel, False)
# print(qmodel)
# print(same_output(model, qmodel, eps=1e-6))
# print(qmodel)
# for n, m in qmodel.named_modules():
# # mod = getattr(model, attr)
# print(n, type(m))
# a = torch.tensor([7.65423], dtype=torch.float64)
# b = torch.tensor([2.24512])
# x = a/b
# print(a, x, torch.frexp(x)[0])
# print(torch.tensor([float("inf")]))
a = [5, 5, 5, 5, 5]
b = [3, 7, 9, 9, 9]
c = 7
print(concat(a, c))