Free Neural Network Programming with PyTorch tutorial, Every module in PyTorch subclasses the nn. Module. A neural network is a module itself that consists of other modules (layers). This nested structure allows for building and managing complex architectures easily.