(self, *inputs, **kwargs)
| 177 | self.module.cuda(device_ids[0]) |
| 178 | |
| 179 | def forward(self, *inputs, **kwargs): |
| 180 | if not self.device_ids: |
| 181 | return self.module(*inputs, **kwargs) |
| 182 | inputs, kwargs = self.scatter(inputs, kwargs, self.device_ids) |
| 183 | if len(self.device_ids) == 1: |
| 184 | return [self.module(*inputs[0], **kwargs[0])] |
| 185 | replicas = self.replicate(self.module, self.device_ids[:len(inputs)]) |
| 186 | outputs = self.parallel_apply(replicas, inputs, kwargs) |
| 187 | if self.gather_bool: |
| 188 | return self.gather(outputs, self.output_device) |
| 189 | else: |
| 190 | return outputs |
| 191 | |
| 192 | def replicate(self, module, device_ids): |
| 193 | return replicate(module, device_ids) |
nothing calls this directly
no test coverage detected