huggingface / huggingface/candle

`RNN::states_to_tensor` behavior

Open
#1,723 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
21k
Forks
1.8k
Avg merge
16h 42m
Merged PRs (30d)
25

Description

Currently [`RNN::states_to_tensor`](https://docs.rs/candle-nn/0.3.3/candle_nn/rnn/trait.RNN.html#tymethod.states_to_tensor) implementations for `LSTM` and `GRU` return 2-dimensional tensor of shape `(batch_size, seq_len * hidden_dim)`.

Is this a correct behavior? Shouldn't they return 3-dimensional tensor of shape `(batch_size, seq_len, hidden_dim)` instead?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the linked RNN::states_to_tensor documentation and inspect its LSTM and GRU implementations. Compare their current 2D output with the proposed (batch_size, seq_len, hidden_dim) shape. Done means the expected shape is resolved and the implementation and documentation consistently reflect that decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
machine-learning
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.