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

Method PSPBlockImpl

src/architectures/PSPNetDecoder.cpp:3–11  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include "PSPNetDecoder.h"
2
3PSPBlockImpl::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
13torch::Tensor PSPBlockImpl::forward(torch::Tensor x) {
14 auto h = x.sizes()[2];

Callers

nothing calls this directly

Calls 1

Conv2dReLUFunction · 0.85

Tested by

no test coverage detected