(self, inp, weight, bias)
| 412 | ) |
| 413 | |
| 414 | def calc_conv(self, inp, weight, bias): |
| 415 | assert self.padding_mode in [ |
| 416 | "zeros", |
| 417 | "reflect", |
| 418 | "replicate", |
| 419 | ] |
| 420 | if self.padding_mode != "zeros": |
| 421 | return conv2d( |
| 422 | pad(inp, self.get_pad_witdth(), self.padding_mode), |
| 423 | weight, |
| 424 | bias, |
| 425 | self.stride, |
| 426 | 0, |
| 427 | self.dilation, |
| 428 | self.groups, |
| 429 | self.conv_mode, |
| 430 | self.compute_mode, |
| 431 | ) |
| 432 | return conv2d( |
| 433 | inp, |
| 434 | weight, |
| 435 | bias, |
| 436 | self.stride, |
| 437 | self.padding, |
| 438 | self.dilation, |
| 439 | self.groups, |
| 440 | self.conv_mode, |
| 441 | self.compute_mode, |
| 442 | ) |
| 443 | |
| 444 | def forward(self, inp): |
| 445 | return self.calc_conv(inp, self.weight, self.bias) |
no test coverage detected