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

Method LinearBnReluImpl

lesson3-BasicModels/BaseModule.cpp:15–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13}
14
15LinearBnReluImpl::LinearBnReluImpl(int in_features, int out_features){
16 ln = register_module("ln", torch::nn::Linear(torch::nn::LinearOptions(in_features, out_features)));
17 bn = register_module("bn", torch::nn::BatchNorm1d(out_features));
18}
19
20torch::Tensor LinearBnReluImpl::forward(torch::Tensor x){
21 x = torch::relu(ln->forward(x));

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected