(self, *inputs, **kwargs)
| 61 | self.module.cuda(device_ids[0]) |
| 62 | |
| 63 | def forward(self, *inputs, **kwargs): |
| 64 | if not self.device_ids: |
| 65 | return self.module(*inputs, **kwargs) |
| 66 | inputs, kwargs = self.scatter(inputs, kwargs, self.device_ids, self.chunk_sizes) |
| 67 | if len(self.device_ids) == 1: |
| 68 | return self.module(*inputs[0], **kwargs[0]) |
| 69 | replicas = self.replicate(self.module, self.device_ids[:len(inputs)]) |
| 70 | outputs = self.parallel_apply(replicas, inputs, kwargs) |
| 71 | return self.gather(outputs, self.output_device) |
| 72 | |
| 73 | def replicate(self, module, device_ids): |
| 74 | return replicate(module, device_ids) |
nothing calls this directly
no test coverage detected