Exemplo n.º 1
0
 def ListDevices(self):
     """Returns a list of available hardware devices."""
     if self._tf_cluster is None:
         return []
     return [
         device_properties_pb2.NamedDevice.FromString(device)
         for device in tf_cluster.TF_ListDevices(self._tf_cluster)
     ]
Exemplo n.º 2
0
 def ListDevices(self):
   """Returns the list of available hardware devices."""
   devices = []
   if self._tf_cluster is not None:
     ret_from_swig = tf_cluster.TF_ListDevices(self._tf_cluster)
     devices = []
     for raw_dev in ret_from_swig:
       devices.append(device_properties_pb2.NamedDevice.FromString(raw_dev))
   return devices