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

Method ConvReluBnImpl

lesson2-TensorOperations/main.cpp:22–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20TORCH_MODULE(ConvReluBn);
21
22ConvReluBnImpl::ConvReluBnImpl(int input_channel, int output_channel, int kernel_size) {
23 conv = register_module("conv", torch::nn::Conv2d(torch::nn::Conv2dOptions(input_channel, output_channel, kernel_size).padding(1)));
24 bn = register_module("bn", torch::nn::BatchNorm2d(output_channel));
25
26}
27
28torch::Tensor ConvReluBnImpl::forward(torch::Tensor x) {
29 x = torch::relu(conv->forward(x));

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected