Tensors, Autograd & Training Loop Tensors & Devices import torch x = torch.tensor([[1.0, 2.0], [3.0, 4.0]]) y = torch.randn(2, 2) z = x + y # broadcasting applies when shapes are compatible but not identical # Move to GP…
ReadData Pipeline & Advanced Training Dataset & DataLoader from torch.utils.data import Dataset, DataLoader from torchvision import transforms class ImageDataset(Dataset): def __init__(self, file_paths, labels): self.file_pa…
ReadSave this stack to your personal DevRecall — add your own notes, track what you're learning, and share what you know with the community.
Get started — free forever