Skip to content
Tutorials ▸

Reference

PyTorch, in plain words

One page per call, written the way the tutorials are: the mechanism first, in ordinary Python you can run, and only then the one line the library collapses it into.

This list grows as the tutorials reach for things. There is no attempt to cover PyTorch — the official documentation does that, and does it better. What is here is the handful of calls a reader has just watched something do by hand, explained while the mechanism is still fresh.

PyTorch cannot be compiled into a browser, so these pages cannot run in front of you the way the tutorials do. Each one instead carries its claims as cells you can run against your own PyTorch: start a small server on your machine and paste the URL it prints into the page. One file, standard library only, and worth reading before you run it — it executes what the page sends it, as you.

Nothing needs it. The tutorials themselves run in the browser on NumPy and always will. The three ways to run these snippets, compared — including what to do if you cannot install Python where you are reading.