def _get_available_gpus(self):
"""Get available GPUs."""
from tensorflow.python.client import device_lib
local_device_protos = device_lib.list_local_devices()
return [int(x.name[-1]) for x in local_device_protos if x.device_type == 'GPU']
评论列表
文章目录