-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_args.py
54 lines (47 loc) · 1.25 KB
/
test_args.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
50
51
52
53
54
import sys, getopt
import argparse
workload_options = [
"conv2d",
"dilated_conv2d",
"depthwise_conv2d",
"pool2d",
"dense",
]
supported_targets = [
"alpha",
"haswell",
"gpu2"
]
def getOptions(args=sys.argv[1:]):
parser = argparse.ArgumentParser(description="Parses command.")
parser.add_argument(
"-t",
"--target",
default="alpha",
help="The target device, you want to compile for and profile on.")
parser.add_argument(
"-w",
"--workload",
default="conv2d",
help="The layer type you want to profile (conv2d, dilated_conv2d, depthwise_conv2d, max_pool2d, avg_pool2d, dense.")
parser.add_argument(
"-i",
"--input",
default=None,
help="An additional input file."
)
options = parser.parse_args(args)
return options
options = getOptions()
print(options)
partition = options.target
if not partition in supported_targets:
print("error, unknown partition")
print("PARTITION:", partition)
workload = options.workload
if not workload in workload_options:
print("error, unknown workload")
print("workload:", workload)
input_path = options.input
if not input_path is None:
print("Additional Input File:",input_path)