MCPcopy Create free account
hub / github.com/AllentDan/LibtorchTutorials / SegmentationHeadImpl

Method SegmentationHeadImpl

lesson6-Segmentation/util.cpp:3–7  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include "util.h"
2
3SegmentationHeadImpl::SegmentationHeadImpl(int in_channels, int out_channels, int kernel_size, double _upsampling){
4 conv2d = torch::nn::Conv2d(conv_options(in_channels, out_channels, kernel_size, 1, kernel_size / 2));
5 upsampling = torch::nn::Upsample(upsample_options(std::vector<double>{_upsampling,_upsampling}));
6 register_module("conv2d",conv2d);
7}
8torch::Tensor SegmentationHeadImpl::forward(torch::Tensor x){
9 x = conv2d->forward(x);
10 x = upsampling->forward(x);

Callers

nothing calls this directly

Calls 2

conv_optionsFunction · 0.70
upsample_optionsFunction · 0.70

Tested by

no test coverage detected