aboutsummaryrefslogtreecommitdiffhomepage
path: root/configure.py
diff options
context:
space:
mode:
authorGravatar Maciej <mbajkowski@hotmail.com>2018-04-30 22:30:58 -0500
committerGravatar Shanqing Cai <cais@google.com>2018-04-30 23:30:58 -0400
commitd0f5bc17560fc97bcc7de9164aa3b237a8d5221d (patch)
tree4590cf4c9a681ea056b048711f1ba35dbd716283 /configure.py
parent9e197152c04ebb81f055067534bd93322d182f0e (diff)
Remove whitespace characters from tf_cuda_compute_capabilities user string (#18986)
Remove all whitespace characters from the user specified tf_cuda_compute_capabilities string as this can results in errors during the split operation, and is easy for users to do as it is natural to insert a space after a comma
Diffstat (limited to 'configure.py')
-rw-r--r--configure.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/configure.py b/configure.py
index b745e374a2..fe15bfc1a4 100644
--- a/configure.py
+++ b/configure.py
@@ -1226,6 +1226,9 @@ def set_tf_cuda_compute_capabilities(environ_cp):
ask_cuda_compute_capabilities, default_cuda_compute_capabilities)
# Check whether all capabilities from the input is valid
all_valid = True
+ # Remove all whitespace characters before splitting the string
+ # that users may insert by accident, as this will result in error
+ tf_cuda_compute_capabilities = ''.join(tf_cuda_compute_capabilities.split())
for compute_capability in tf_cuda_compute_capabilities.split(','):
m = re.match('[0-9]+.[0-9]+', compute_capability)
if not m: