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

Method GAUBlockImpl

src/architectures/PANDecoder.cpp:75–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75GAUBlockImpl::GAUBlockImpl(int in_channels, int out_channels, std::string upscale_mode) {
76 align_corners = upscale_mode == "bilinear";
77 conv1 = torch::nn::Sequential(
78 torch::nn::AdaptiveAvgPool2d(torch::nn::AdaptiveAvgPool2dOptions(1)),
79 ConvBnRelu(out_channels, out_channels, 1, 1, 0, 1, 1, true, false),
80 torch::nn::Sigmoid()
81 );
82 conv2 = ConvBnRelu(in_channels, out_channels, 3, 1, 1);
83
84 register_module("conv1", conv1);
85 register_module("conv2", conv2);
86}
87
88torch::Tensor GAUBlockImpl::forward(torch::Tensor x, torch::Tensor y) {
89 auto h = x.sizes()[2];

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected