| 1 | #include "PSPNetDecoder.h" |
| 2 | |
| 3 | PSPBlockImpl::PSPBlockImpl(int in_channels, int out_channels, int pool_size, bool use_bathcnorm) { |
| 4 | if (pool_size == 1) |
| 5 | use_bathcnorm = false; |
| 6 | pool = torch::nn::Sequential(torch::nn::AdaptiveAvgPool2d(torch::nn::AdaptiveAvgPool2dOptions(pool_size))); |
| 7 | conv = Conv2dReLU(in_channels, out_channels, 1, 0, 1, use_bathcnorm); |
| 8 | |
| 9 | register_module("pool", pool); |
| 10 | register_module("conv", conv); |
| 11 | } |
| 12 | |
| 13 | torch::Tensor PSPBlockImpl::forward(torch::Tensor x) { |
| 14 | auto h = x.sizes()[2]; |
nothing calls this directly
no test coverage detected