(self, input_)
| 351 | |
| 352 | |
| 353 | def forward(self, input_): |
| 354 | # Set up backprop all-reduce. |
| 355 | if self.input_is_parallel: |
| 356 | input_parallel = input_ |
| 357 | else: |
| 358 | input_parallel = scatter_to_model_parallel_region(input_) |
| 359 | # Matrix multiply. |
| 360 | output_parallel = F.linear(input_parallel, self.weight) |
| 361 | # All-reduce across all the partitions. |
| 362 | output_ = reduce_from_model_parallel_region(output_parallel) |
| 363 | if not self.skip_bias_add: |
| 364 | output = output_ + self.bias if self.bias is not None else output_ |
| 365 | output_bias = None |
| 366 | else: |
| 367 | output = output_ |
| 368 | output_bias = self.bias |
| 369 | return output, output_bias |
nothing calls this directly
no test coverage detected