def get_devices(self):
     raw_devices = self.benchmark_cnn.raw_devices
     if self.benchmark_cnn.local_parameter_device_flag == 'gpu':
         return [
             variable_mgr_util.ParamServerDeviceSetter(d, raw_devices)
             for d in raw_devices
         ]
     else:
         return [
             tf.train.replica_device_setter(
                 worker_device=d,
                 ps_device=self.benchmark_cnn.param_server_device,
                 ps_tasks=1) for d in raw_devices
         ]
Exemplo n.º 2
0
 def get_devices(self):
     raw_devices = self.model_helper.raw_devices
     if self.model_helper.local_parameter_device == "gpu":
         return [
             variable_mgr_util.ParamServerDeviceSetter(d, raw_devices)
             for d in raw_devices
         ]
     else:
         return [
             tf.train.replica_device_setter(
                 worker_device=d,
                 ps_device=self.model_helper.param_server_device,
                 ps_tasks=1,
             ) for d in raw_devices
         ]