PyTorch: Deep Learning the Pythonic Way cover

AI & ML · Ebook

PyTorch: Deep Learning the Pythonic Way

by Shriira Press

4.7(7,099)93 pagesPublished 2026

A comprehensive, self-contained guide to PyTorch, the deep-learning framework that powers most modern AI research and a great deal of production. PyTorch's appeal is that it feels like Python and NumPy with gradients and a GPU — you write ordinary code, and the framework differentiates it. This book teaches that style end to end: tensors and autograd, the nn.Module abstraction, the explicit training loop that is PyTorch's signature, Dataset/DataLoader input pipelines, CNNs and transformers, transfer learning, and deployment with TorchScript, torch.compile, ONNX, and ExecuTorch. It blends intuition, the concepts behind the API, and runnable code.

Contents

  1. 1Preface
  2. 2Chapter 1 — What Is PyTorch?
  3. 3Chapter 2 — Tensors and Autograd
  4. 4Chapter 3 — Your First Neural Network
  5. 5Chapter 4 — Building Models with nn.Module
  6. 6Chapter 5 — The Training Loop in Depth
  7. 7Chapter 6 — Data: Datasets, DataLoaders, and Transforms
  8. 8Chapter 7 — Layers, Activations, and Building Blocks
  9. 9Chapter 8 — Convolutional Networks for Images
  10. 10Chapter 9 — Sequence Models: RNNs, LSTMs, and Transformers
  11. 11Chapter 10 — Regularization, Tuning, and Training Tricks
  12. 12Chapter 11 — Transfer Learning and Pretrained Models
  13. 13Chapter 12 — Saving, Compiling, and Deployment
  14. 14Chapter 13 — The Ecosystem, Scaling, and the Profession
  15. 15Appendix A — Glossary and API Quick Reference
  16. 16Appendix B — Further Reading and Resources