Skip to content
masterclass Buddy

PyTorch · Class

TensorDataset

torch.nn is a set of neural-network building blocks. Together with optimizers, datasets, and data loaders, it helps define models, update their weights, and feed them batches.

Last updated

Syntax

class MyModel(nn.Module):
    def __init__(self):
        super().__init__()

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • torch.nn
  • torch.nn.Module
  • torch.nn.functional
  • torch.optim
  • Parameter
  • Dataset
  • TensorDataset
  • DataLoader

Source: What is torch.nn really? — PyTorch Tutorials 2.15.0+cu132 documentation. Checked 2026-11-03.