forked from ARM-software/SCALE-Sim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgen_min.py
47 lines (34 loc) · 831 Bytes
/
gen_min.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
import os
#net_name = "resnet1_int8"
#net_name = "yolo_v2"
net_name = "yolo_tiny"
dump_file = net_name + "_min.csv"
command = "ls " + net_name + "/ > tmp"
os.system(command)
lst = open("tmp", 'r')
min_file = open(dump_file, 'a')
for fname in lst:
fname = fname.strip()
fname = net_name +"/" + fname
f = open(fname, 'r')
first = True
min_cycl= 1000000000
min_dim = ""
for l in f:
if first:
first = False
else:
entry = l.strip().split(',')
cycl = float(entry[1])
#print(entry[0])
if cycl < min_cycl:
min_cycl = cycl
min_dim = entry[0]
log = min_dim + "\n"
print(log)
min_file.write(log)
f.close()
lst.close()
min_file.close()
command = "rm -rf tmp"
os.system(command)