def setup_workers(self):
    if self._initialized:
        return
    self._initialized = True
    self._master.cleargrads()
    for i in six.moves.range(1, len(self._devices)):
        (pipe, worker_end) = multiprocessing.Pipe()
        worker = _Worker(i, worker_end, self)
        worker.start()
        self._workers.append(worker)
        self._pipes.append(pipe)
    with cuda.Device(self._devices[0]):
        self._master.to_gpu(self._devices[0])
        if (len(self._devices) > 1):
            comm_id = nccl.get_unique_id()
            self._send_message(('set comm_id', comm_id))
            self.comm = nccl.NcclCommunicator(len(self._devices), comm_id, 0)
def setup_workers(self):
    if self._initialized:
        return
    self._initialized = True
    self._master.cleargrads()
    for i in six.moves.range(1, len(self._devices)):
        (pipe, worker_end) = multiprocessing.Pipe()
        worker = _Worker(i, worker_end, self)
        worker.start()
        self._workers.append(worker)
        self._pipes.append(pipe)
    with cuda.Device(self._devices[0]):
        self._master.to_gpu(self._devices[0])
        if (len(self._devices) > 1):
            comm_id = nccl.get_unique_id()
            self._send_message(('set comm_id', comm_id))
            self.comm = nccl.NcclCommunicator(len(self._devices), comm_id, 0)