onnx: implement LSTM op (#2268)

use candle-nn LSTM
This commit is contained in:
shua
2024-08-19 09:06:17 +02:00
committed by GitHub
parent 236b29ff15
commit 31a1075f4b
3 changed files with 709 additions and 0 deletions

View File

@ -55,6 +55,10 @@ pub struct LSTMState {
}
impl LSTMState {
pub fn new(h: Tensor, c: Tensor) -> Self {
LSTMState { h, c }
}
/// The hidden state vector, which is also the output of the LSTM.
pub fn h(&self) -> &Tensor {
&self.h