| 32 | } |
| 33 | |
| 34 | DecoderBlockImpl::DecoderBlockImpl(int in_channels, int skip_channels, int out_channels, bool skip, bool attention){ |
| 35 | conv1 = Conv2dReLU(in_channels + skip_channels, out_channels, 3, 1); |
| 36 | conv2 = Conv2dReLU(out_channels, out_channels, 3, 1); |
| 37 | register_module("conv1", conv1); |
| 38 | register_module("conv2", conv2); |
| 39 | upsample = torch::nn::Upsample(torch::nn::UpsampleOptions().scale_factor(std::vector<double>({2,2})).mode(torch::kNearest)); |
| 40 | |
| 41 | attention1 = SCSEModule(in_channels + skip_channels, 16, attention); |
| 42 | attention2 = SCSEModule(out_channels, 16, attention); |
| 43 | register_module("attention1", attention1); |
| 44 | register_module("attention2", attention2); |
| 45 | is_skip = skip; |
| 46 | } |
| 47 | |
| 48 | torch::Tensor DecoderBlockImpl::forward(torch::Tensor x, torch::Tensor skip){ |
| 49 | x = upsample->forward(x); |
nothing calls this directly
no outgoing calls
no test coverage detected