Skip to content

Commit c2580fb

Browse files
committed
add scripts
1 parent 28a8409 commit c2580fb

File tree

4 files changed

+116
-0
lines changed

4 files changed

+116
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# This is a work-in-progress.
2+
# The idea is to generate a combination of builds
3+
# with different parameters.
4+
5+
from pathlib import Path
6+
import yaml
7+
import itertools
8+
9+
base_dir = Path('../')
10+
config_path = Path('build_config.yml')
11+
12+
config = yaml.load(open(config_path))
13+
matrix = config['matrix']
14+
excluded = config['exclude']
15+
16+
# List all possible combinations
17+
matrix_keys = sorted(matrix)
18+
temp_builds = list(itertools.product(*(matrix[key] for key in matrix_keys)))
19+
20+
# Exclude unwanted builds.
21+
builds = []
22+
for temp_build in temp_builds:
23+
build = dict(zip(matrix_keys, temp_build))
24+
25+
do_exclude = False
26+
for exclude_build in excluded:
27+
exclude_count = 0
28+
for k, v in exclude_build.items():
29+
if build[k] == v:
30+
exclude_count += 1
31+
if exclude_count == len(exclude_build):
32+
do_exclude = True
33+
34+
if not do_exclude:
35+
builds.append(build)
36+
37+
print(builds)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
matrix:
2+
python_version:
3+
- 3.6
4+
- 3.7
5+
tf_version:
6+
- v1.13.1
7+
- v2.0.0-alpha0
8+
use_gpu:
9+
- True
10+
- False
11+
cuda_version:
12+
- 9.2
13+
- 10.0
14+
cudnn_version:
15+
- 7.1
16+
- 7.5
17+
exclude:
18+
- tf_version: v1.13.1
19+
cuda_version: 10.0
20+
- cudnn_version: 7.1
21+
cuda_version: 10.0

scripts/build_all.py

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# This is a work-in-progress.
2+
# The idea is to generate a combination of builds
3+
# with different parameters.
4+
5+
from pathlib import Path
6+
import yaml
7+
import itertools
8+
9+
base_dir = Path('../')
10+
config_path = Path('build_config.yml')
11+
12+
config = yaml.load(open(config_path))
13+
matrix = config['matrix']
14+
excluded = config['exclude']
15+
16+
# List all possible combinations
17+
matrix_keys = sorted(matrix)
18+
temp_builds = list(itertools.product(*(matrix[key] for key in matrix_keys)))
19+
20+
# Exclude unwanted builds.
21+
builds = []
22+
for temp_build in temp_builds:
23+
build = dict(zip(matrix_keys, temp_build))
24+
25+
do_exclude = False
26+
for exclude_build in excluded:
27+
exclude_count = 0
28+
for k, v in exclude_build.items():
29+
if build[k] == v:
30+
exclude_count += 1
31+
if exclude_count == len(exclude_build):
32+
do_exclude = True
33+
34+
if not do_exclude:
35+
builds.append(build)
36+
37+
print(builds)

scripts/build_config.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
matrix:
2+
python_version:
3+
- 3.6
4+
- 3.7
5+
tf_version:
6+
- v1.13.1
7+
- v2.0.0-alpha0
8+
use_gpu:
9+
- True
10+
- False
11+
cuda_version:
12+
- 9.2
13+
- 10.0
14+
cudnn_version:
15+
- 7.1
16+
- 7.5
17+
exclude:
18+
- tf_version: v1.13.1
19+
cuda_version: 10.0
20+
- cudnn_version: 7.1
21+
cuda_version: 10.0

0 commit comments

Comments
 (0)