PyTorch is a deep learning framework that pairs eager-mode tensor operations with automatic differentiation through dynamic computation graphs. The 2.x release line introduced torch.compile for ahead-of-time graph capture and kernel fusion, FSDP (Fully Sharded Data Parallel) for training models too large to fit in single-GPU memory, and stable support for MPS (Apple Silicon GPU). Students meet PyTorch in CS231n (Stanford CNNs), CS224n (Stanford NLP), 6.S898 (MIT Deep Learning), Fast.ai courses, and any modern deep learning elective because the research community publishes overwhelmingly in PyTorch over TensorFlow.
The library splits into torch (tensor operations and autograd), torch.nn (layers and modules), torch.optim (optimizers: SGD, Adam, AdamW, RMSprop), torch.utils.data (Dataset and DataLoader), torchvision (computer vision datasets, transforms, pretrained models), torchaudio, and torchtext. CSHH tutors deliver nn.Module subclasses with explicit __init__ for layer registration and forward for the computation, training loops with explicit optimizer.zero_grad before loss.backward and optimizer.step, DataLoader with num_workers > 0 for parallel data loading and pin_memory=True for faster host-to-device transfer, mixed precision via torch.cuda.amp.autocast and GradScaler, and the model.train versus model.eval mode switching that affects Dropout and BatchNorm behavior.