Skip to content

Feature request: reverse_padded_sequence #1794

@rdipietro

Description

@rdipietro

Hi,

There's existing discussion around a more extendable RNN API, which as of yet hasn't moved forward. Given that, and that PackedSequences exist, would a reverse_padded_sequence function be useful, or do you just see it as being unnecessary clutter?

In particular it'd take in a Variable of padded sequences along with sequence lengths (and a batch_first option) and produce a Variable of padded sequences that are reversed according to their lengths, mimicking reverse_sequence in TensorFlow.

My thought is that this option would be a useful alternative to PackedSequences in the case of bidirectional RNNs. (PackedSequences seem to be primarily motivated by cuDNN, whereas in a research setting they might introduce more bookkeeping than they're worth.)

cc @ezyang @gchanan @zou3519

Metadata

Metadata

Assignees

No one assigned

    Labels

    actionableenhancementNot as big of a feature, but technically not a bug. Should be easy to fixmodule: rnnIssues related to RNN support (LSTM, GRU, etc)triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions