()
return devices, len(devices)
:returns, list of gpu device name, num of gpus
:returns, list of gpu device name, num of gpus
: returns list of gpu device name num of gpus
def gpu_device_names():
  '''
  :returns, list of gpu device name, num of gpus
  '''
  devices = []
  for x in device_lib.list_local_devices():  #pylint: disable=invalid-name
    if x.device_type == 'GPU':
      devices.append(tf.compat.as_text(x.name))
  return devices, len(devices)
def gpu_device_names ( ) : devices = [ ] for x in device_lib . list_local_devices ( ) : #pylint: disable=invalid-name if x . device_type == 'GPU' : devices . append ( tf . compat . as_text ( x . name ) ) return devices , len ( devices )