Customized RNN cell which can accept packsequence


I saw the packsequence class which presumably can speed up the RNN computation by ignoring the paddings.

My question is, if I want to use my own cell, how can I build a RNN module which can accept Packsequence.

I’ve looked up the code, but it seems nontrivial. I feel like it should be easily down by a wrapper.

Is there any example use case or any suggestions?

1 Like

This code takes in a PackedSequence as input and computes the forward correctly.

Hopefully this makes it simpler to understand and write your own code that takes in a PackedSequence:

1 Like