Returns a boolean value representing whether the current device has a GPU or not :return: Whether the current device has a GPU or not (bool)
(self)
| 106 | if device.device_type == 'GPU'] |
| 107 | |
| 108 | def is_gpu_available(self): |
| 109 | ''' |
| 110 | Returns a boolean value representing whether the current device has a GPU or not |
| 111 | |
| 112 | :return: Whether the current device has a GPU or not (bool) |
| 113 | ''' |
| 114 | return tf.test.gpu_device_name() != '' |