Why does nn.Flatten not exist?

which would do something like

out = inp.view(inp.size(0), -1)
return out

This module was recently merged.
However, it looks like the docs are missing.

docs show in colab


one more thing, how to implement show_batch without using matplotlib?
I raised pull request, but I used matplotlib, and torchvision does not use matplotlib.
Is there a way to show a batch of dataset, so it could be used like this

for batch, labels in dl:
  show_batch(batch)

The docs also show up in IPython, so maybe there is some issue on the website.

If you don’t want to use matplotlib, you could use e.g. PIL instead.
However, in your code you are free to use whatever works for you.

@ptrblck the function is missing there because you are on the stable doc, not master’s doc!

I’m pretty sure I was looking at both and reported it. :face_with_raised_eyebrow:

However, the master docs are now there.
Since this module is available in 1.2.0, I think we might need to fix the stable docs as well.

1 Like