How to use 'tensorflow disable gpu' in Python

Every line of 'tensorflow disable gpu' 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.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
152def gpu_available_in_session():
153 sess = tfv1.get_default_session()
154 for dev in sess.list_devices():
155 if dev.device_type.lower() == 'gpu':
156 return True
157 return False

Related snippets