| 1 | #include<MLP.h> |
| 2 | |
| 3 | MLP::MLP(int in_features, int out_features){ |
| 4 | ln1 = LinearBnRelu(in_features, mid_features[0]); |
| 5 | ln2 = LinearBnRelu(mid_features[0], mid_features[1]); |
| 6 | ln3 = LinearBnRelu(mid_features[1], mid_features[2]); |
| 7 | out_ln = torch::nn::Linear(mid_features[2], out_features); |
| 8 | |
| 9 | ln1 = register_module("ln1", ln1); |
| 10 | ln2 = register_module("ln2", ln2); |
| 11 | ln3 = register_module("ln3", ln3); |
| 12 | out_ln = register_module("out_ln",out_ln); |
| 13 | } |
| 14 | |
| 15 | torch::Tensor MLP::forward(torch::Tensor x){ |
| 16 | x = ln1->forward(x); |
nothing calls this directly
no outgoing calls
no test coverage detected