|TensorFlow 1 version||View source on GitHub|
Returns whether TensorFlow was built with GPU (CUDA or ROCm) support.
Compat aliases for migration
See Migration guide for more details.
This method should only be used in tests written with
typical usage is to skip tests that should only run with GPU.
if not tf.test.is_built_with_gpu_support():
self.skipTest("test is only applicable on GPU")
self.assertEqual(tf.math.add(1.0, 2.0), 3.0)
TensorFlow official binary is built with CUDA GPU support.