oa::ml::matrix::rnn_scan

Run a whole-sequence Elman recurrence from a zero hidden state. gates_i has shape [batch, sequence, hidden], weight_hh has [hidden, hidden], and an optional recurrent bias has [hidden]. Errors Returns an error unless all values are nonempty same-engine F32 matrices, shapes agree, hidden size is at most 1024, or runtime recording fails.

FnRust public API

Function Documentation

pub fn rnn_scan( gates_i: &Matrix, weight_hh: &Matrix, bias_hh: Option<&Matrix> ) -> Result<Matrix>
Run a whole-sequence Elman recurrence from a zero hidden state. gates_i has shape [batch, sequence, hidden], weight_hh has [hidden, hidden], and an optional recurrent bias has [hidden]. Errors Returns an error unless all values are nonempty same-engine F32 matrices, shapes agree, hidden size is at most 1024, or runtime recording fails.