| 38 | } |
| 39 | |
| 40 | PSPDecoderImpl::PSPDecoderImpl(std::vector<int> encoder_channels, int out_channels, double _dropout, |
| 41 | bool use_batchnorm, int _encoder_depth) { |
| 42 | encoder_depth = _encoder_depth; |
| 43 | std::vector<int> size = { 1, 2, 3, 6 }; |
| 44 | psp = PSPModule(encoder_channels[encoder_depth], size, use_batchnorm); |
| 45 | conv = Conv2dReLU(encoder_channels[encoder_depth] * 2, out_channels, 1, 0, 1, use_batchnorm); |
| 46 | dropout = torch::nn::Dropout2d(torch::nn::Dropout2dOptions(_dropout)); |
| 47 | |
| 48 | register_module("psp", psp); |
| 49 | register_module("conv", conv); |
| 50 | } |
| 51 | |
| 52 | torch::Tensor PSPDecoderImpl::forward(std::vector<torch::Tensor> features) { |
| 53 | auto x = features[features.size()-1]; |
nothing calls this directly
no test coverage detected