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

Method ConvReluBnImpl

lesson3-BasicModels/BaseModule.cpp:3–7  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include"BaseModule.h"
2
3ConvReluBnImpl::ConvReluBnImpl(int input_channel, int output_channel, int kernel_size, int stride) {
4 conv = register_module("conv", torch::nn::Conv2d(conv_options(input_channel,output_channel,kernel_size,stride,kernel_size/2)));
5 bn = register_module("bn", torch::nn::BatchNorm2d(output_channel));
6
7}
8
9torch::Tensor ConvReluBnImpl::forward(torch::Tensor x) {
10 x = torch::relu(conv->forward(x));

Callers

nothing calls this directly

Calls 1

conv_optionsFunction · 0.70

Tested by

no test coverage detected