
Deep Learning with PyTorch
Second Edition
Technical reference walking practitioners through tensor memory internals, automatic differentiation, multi-GPU orchestration, and an end-to-end CT diagnostic pipeline.
As an Amazon Associate, Science Petal earns from qualifying purchases made through links at no additional cost to you.
About the Book
Written by distributed training engineer Howard Huang alongside original edition authors Eli Stevens, Luca Antiga, and Thomas Viehmann, this second edition takes developers under the hood of the PyTorch framework. It reveals how tensor views map to contiguous memory and how autograd tracks derivatives.
The book centers on a full-scale medical imaging project, building a 3D lung cancer classifier from raw CT scans. It provides exhaustive coverage of modern distributed training across multi-GPU clusters, transformer internals, and generative vision architectures.
Key ideas
- Tensors Are Views into 1D Storage: Understanding strides and contiguous memory layouts prevents costly memory duplications during high-performance matrix math.
- Real ML Demands Resilient Data Ingestion: Building production 3D volumetric pipelines teaches you how to handle memory bottlenecks, class imbalance, and dirty medical data.
- Scale Linearly with PyTorch DDP: Distributed Data Parallel synchronizes gradients across GPU process groups efficiently without bottlenecking Python's GIL.
Why You'll Love This Book
- Written by core PyTorch contributors and practitioners, this revised second edition covers distributed training, transformers, and generative models from the inside out.
- Offers deep architectural insights, production-ready code, rigorous performance profiling, and complete mastery of the pytorch framework.
- Examines tensor storage and memory layout, the autograd engine and computational graphs, and end-to-end medical imaging project (ct scans) through concrete cases and practical examples.
- Gives readers a clear vocabulary and reference points they can revisit in everyday work.
Problem Solved
Surface-level PyTorch guides leave developers struggling when models crash or run out of memory. This book solves internal bottlenecks:
- Eliminating CUDA Out of Memory Errors: Diagnose gradient graph retention, optimize batch sizes, and manage GPU memory caches effectively.
- Building Realistic 3D Ingestion Pipelines: Handle large volumetric DICOM medical images with custom preprocessing and data augmentation.
- Multi-GPU Distributed Training: Set up PyTorch DDP scripts that scale linear throughput across multi-node GPU clusters.
Final Verdict
An essential, authoritative manual written by PyTorch creators that unlocks the full performance potential of modern deep learning hardware.
“Tensors are not just multidimensional arrays; they are views into contiguous memory storage that power automatic differentiation.”
Compare Before You Decide


Deep Learning with PyTorch vs Hands-On Machine Learning with Scikit-Learn and PyTorch
Deep Learning with PyTorch by Howard Huang, Eli Stevens, Luca Antiga & Thomas Viehmann focuses on tensor storage and memory layout (560 pages (~14h read)), whereas Hands-On Machine Learning with Scikit-Learn and PyTorch by Aurélien Géron examines scikit-learn workflows and data transformations (820 pages (~20h read)).


Deep Learning with PyTorch vs Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow
Deep Learning with PyTorch by Howard Huang, Eli Stevens, Luca Antiga & Thomas Viehmann focuses on tensor storage and memory layout (560 pages (~14h read)), whereas Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow by Aurélien Géron examines end-to-end machine learning project architecture (856 pages (~22h read)).
Related Books

Hands-On Machine Learning with Scikit-Learn and PyTorch
Aurélien Géron

Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow
Aurélien Géron

Deep Learning for Coders with fastai and PyTorch
Jeremy Howard and Sylvain Gugger

The Master Algorithm
Pedro Domingos

Deep Learning with Python
François Chollet

Co-Intelligence
Ethan Mollick