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

Class LSTM

lesson3-BasicModels/LSTM.h:16–24  ·  view source on GitHub ↗

batch_first: true for io(batch, seq, feature) else io(seq, batch, feature)

Source from the content-addressed store, hash-verified

14
15//batch_first: true for io(batch, seq, feature) else io(seq, batch, feature)
16class LSTM: public torch::nn::Module{
17public:
18 LSTM(int in_features, int hidden_layer_size, int out_size, int num_layers, bool batch_first);
19 torch::Tensor forward(torch::Tensor x);
20private:
21 torch::nn::LSTM lstm{nullptr};
22 torch::nn::Linear ln{nullptr};
23 std::tuple<torch::Tensor, torch::Tensor> hidden_cell;
24};

Callers 2

LSTMMethod · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected