Can not import pad_sequence?

The docs say we can do this, but I get the following error:

>>> from torch.nn.utils.rnn import pad_sequence
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name pad_sequence

I tried in both python2 and 3 and my torch version is torch (0.3.0.post4). What am I missing?

You should be looking at the docs for version 0.3.0 not those for master
http://pytorch.org/docs/0.3.0/nn.html

pad_sequence isn’t mentioned in version 0.3.0. I guess it was added more recently.