Last active
September 10, 2020 10:05
-
-
Save nkpro2000sr/386b2af9a04450f6c46d9ce0ef0c4453 to your computer and use it in GitHub Desktop.
To build TensorFlow from source in colab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
with open(sys.argv[1], 'r') as target_txt: | |
targets = target_txt.read() | |
targets = targets.partition('\n\n')[0] | |
targets = targets.splitlines()[1:] | |
copts = [] | |
for target in targets: | |
arg = target.split() | |
if len(arg) == 1: | |
continue | |
elif arg[1] == '[disabled]': | |
continue | |
elif arg[1] == '[default]': | |
continue | |
elif arg[1] == '[enabled]': | |
copts.append(arg[0]) | |
else: | |
copts.append(''.join(arg)) | |
with open(sys.argv[2], 'w') as target_arg: | |
target_arg.write(' '.join(['--copt='+copt for copt in copts])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try Now 😉