MCPcopy Create free account
hub / github.com/AllentDan/LibtorchSegmentation / LinknetDecoderImpl

Method LinknetDecoderImpl

src/architectures/LinknetDecoder.cpp:43–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43LinknetDecoderImpl::LinknetDecoderImpl(std::vector<int> encoder_channels, int prefinal_channels,
44 int n_blocks, bool use_batchnorm) {
45 encoder_channels = std::vector<int>(encoder_channels.begin()+1, encoder_channels.end());
46 std::reverse(std::begin(encoder_channels), std::end(encoder_channels));
47 std::vector<int> channels = encoder_channels;
48 channels.push_back(prefinal_channels);
49 for (int i = 0; i < n_blocks; i++) {
50 blocks->push_back(DecoderBlockLink(channels[i], channels[i + 1], use_batchnorm));
51 }
52
53 register_module("blocks", blocks);
54}
55
56torch::Tensor LinknetDecoderImpl::forward(std::vector< torch::Tensor> features) {
57 features = std::vector<torch::Tensor>(features.begin() + 1, features.end());

Callers

nothing calls this directly

Calls 5

beginFunction · 0.85
endFunction · 0.85
beginMethod · 0.80
endMethod · 0.80
push_backMethod · 0.80

Tested by

no test coverage detected