(ctx, input, filter, bias)
| 87 | class ScipyConv2dFunction(Function): |
| 88 | @staticmethod |
| 89 | def forward(ctx, input, filter, bias): |
| 90 | # detach so we can cast to NumPy |
| 91 | input, filter, bias = input.detach(), filter.detach(), bias.detach() |
| 92 | result = correlate2d(input.numpy(), filter.numpy(), mode='valid') |
| 93 | result += bias.numpy() |
| 94 | ctx.save_for_backward(input, filter, bias) |
| 95 | return torch.as_tensor(result, dtype=input.dtype) |
| 96 | |
| 97 | @staticmethod |
| 98 | def backward(ctx, grad_output): |
nothing calls this directly
no outgoing calls
no test coverage detected