79470696

Date: 2025-02-26 18:13:57
Score: 0.5
Natty:
Report link

The function torch.nn.utils.rnn.pad_sequence now supports left-padding, so you can just use:

torch.nn.utils.rnn.pad_sequence(
    [torch.tensor(t) for t in f], batch_first=True, padding_side='left'
)

to get what you're looking for.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: hamza