| nn_stack_time_steps | R Documentation |
Shared by the LSTM and GRU builds for return_sequences = TRUE.
nn_stack_time_steps(ctx, h_steps, units, batch_size)
ctx |
ggml compute context. |
h_steps |
List of per-step tensors, each |
units |
Integer, the hidden width. |
batch_size |
Integer, N. |
Each step is [units, N], and the result has to be
[units, seq_len, N] – the layout every sequence consumer expects.
Concatenating the steps directly along dim 1 does not give that: it
produces [units, seq_len * N], folding the batch into the sequence
axis. Nothing complains at build time, and a consumer that only reads
ne[0] (attention) still works, so the mistake surfaces far away –
sequence_pooling reduces the wrong axis and its
ggml_reshape_2d() aborts the process on the element count.
Giving each step an explicit unit sequence axis first ([units, 1, N])
makes the concatenation grow that axis instead, which is the intended
result.
A tensor [units, seq_len, N].
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.