Every line of 'tensorflow gpu check' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.
204 def is_gpu_available(): 205 from tensorflow.python.client import device_lib 206 local_device_protos = device_lib.list_local_devices() 207 gpu_list = [x.name for x in local_device_protos if x.device_type == 'GPU'] 208 if len(gpu_list) > 0: 209 print("Tensorflow GPU:", gpu_list) 210 return True 211 else: 212 return False
Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code