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

Method LSTM

lesson3-BasicModels/LSTM.cpp:3–9  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include<LSTM.h>
2
3LSTM::LSTM(int in_features, int hidden_layer_size, int out_size, int num_layers, bool batch_first){
4 lstm = torch::nn::LSTM(lstmOption(in_features, hidden_layer_size, num_layers, batch_first));
5 ln = torch::nn::Linear(hidden_layer_size, out_size);
6
7 lstm = register_module("lstm",lstm);
8 ln = register_module("ln",ln);
9}
10
11torch::Tensor LSTM::forward(torch::Tensor x){
12 auto lstm_out = lstm->forward(x);

Callers

nothing calls this directly

Calls 2

LSTMClass · 0.85
lstmOptionFunction · 0.85

Tested by

no test coverage detected