diff options
author | Derek Murray <mrry@google.com> | 2017-09-12 17:03:13 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-09-12 17:07:07 -0700 |
commit | 59bdf598d2cf386507aab4e56c5ffffcaebcb880 (patch) | |
tree | eeb18697247c02a09c70740e14d0028c4a746c1a /tensorflow/python/platform | |
parent | c3b86347f2433b892e2eaab3516d463b379666f7 (diff) |
Add an automatically-generated "tensorflow.python.platform.build_info" script.
The motivation for this script is to provide better tools for
diagnosing load-time errors (such as the ones that plague the Windows
build due to DLL issues). Note that the script is intended to be
self-contained, so that it is possible to import it without loading
the entire TensorFlow runtime.
This generated script currently contains a single symbol,
`is_cuda_build`, which records whether the build has GPU support or not.
PiperOrigin-RevId: 168471034
Diffstat (limited to 'tensorflow/python/platform')
-rw-r--r-- | tensorflow/python/platform/build_info_test.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tensorflow/python/platform/build_info_test.py b/tensorflow/python/platform/build_info_test.py new file mode 100644 index 0000000000..581f3c19f6 --- /dev/null +++ b/tensorflow/python/platform/build_info_test.py @@ -0,0 +1,32 @@ +# Copyright 2015 The TensorFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================== +"""Test for the generated build_info script.""" + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +from tensorflow.python.platform import build_info +from tensorflow.python.platform import test + + +class BuildInfoTest(test.TestCase): + + def testBuildInfo(self): + self.assertEqual(build_info.is_cuda_build, test.is_built_with_cuda()) + + +if __name__ == '__main__': + test.main() |