(input, weight, bias=None)
| 94 | @staticmethod |
| 95 | # bias is an optional argument |
| 96 | def forward(input, weight, bias=None): |
| 97 | |
| 98 | if input.dim() == 2 and bias is not None: |
| 99 | # fused op is marginally faster |
| 100 | ret = torch.addmm(bias, input, weight.t()) |
| 101 | else: |
| 102 | output = input.matmul(weight.t()) |
| 103 | if bias is not None: |
| 104 | output += bias |
| 105 | ret = output |
| 106 | |
| 107 | return ret |
| 108 | |
| 109 | @staticmethod |
| 110 | def setup_context(ctx, inputs, output): |
nothing calls this directly
no outgoing calls
no test coverage detected