Class LSTMCellImpl¶
Defined in File rnn.h
Page Contents
Inheritance Relationships¶
Base Type¶
public torch::nn::detail::RNNCellImplBase< LSTMCellImpl >
(Template Class RNNCellImplBase)
Class Documentation¶
-
class LSTMCellImpl : public torch::nn::detail::RNNCellImplBase<LSTMCellImpl>¶
A long short-term memory (LSTM) cell.
See https://pytorch.org/docs/main/nn.html#torch.nn.LSTMCell to learn about the exact behavior of this module.
See the documentation for
torch::nn::LSTMCellOptions
class to learn what constructor arguments are supported for this module.Example:
LSTMCell model(LSTMCellOptions(20, 10).bias(false));
Public Functions
-
inline LSTMCellImpl(int64_t input_size, int64_t hidden_size)¶
-
explicit LSTMCellImpl(const LSTMCellOptions &options_)¶
-
std::tuple<Tensor, Tensor> forward(const Tensor &input, std::optional<std::tuple<Tensor, Tensor>> hx_opt = {})¶
Public Members
-
LSTMCellOptions options¶
Protected Functions
-
inline virtual bool _forward_has_default_args() override¶
The following three functions allow a module with default arguments in its forward method to be used in a Sequential module.
You should NEVER override these functions manually. Instead, you should use the
FORWARD_HAS_DEFAULT_ARGS
macro.
-
inline virtual unsigned int _forward_num_required_args() override¶
Friends
- friend struct torch::nn::AnyModuleHolder
-
inline LSTMCellImpl(int64_t input_size, int64_t hidden_size)¶