Args: gpus ([int]): list of GPU ids. scale_gradient (bool): if True, will scale each gradient by ``1.0/nr_gpu``.
(self, gpus, scale_gradient=True)
| 127 | |
| 128 | @map_arg(gpus=_int_to_range) |
| 129 | def __init__(self, gpus, scale_gradient=True): |
| 130 | """ |
| 131 | Args: |
| 132 | gpus ([int]): list of GPU ids. |
| 133 | scale_gradient (bool): if True, will scale each gradient by ``1.0/nr_gpu``. |
| 134 | """ |
| 135 | self.devices = gpus |
| 136 | self._builder = AsyncMultiGPUBuilder(gpus, scale_gradient) |
| 137 | super(AsyncMultiGPUTrainer, self).__init__() |
| 138 | |
| 139 | def _setup_graph(self, input, get_cost_fn, get_opt_fn): |
| 140 | if len(self.devices) > 1: |
nothing calls this directly
no test coverage detected