Learning PyTorch with Examples — PyTorch Tutorials 1.10.1 ...
pytorch.org › tutorials › beginnerHere we use PyTorch Tensors and autograd to implement our fitting sine wave with third order polynomial example; now we no longer need to manually implement the backward pass through the network: # -*- coding: utf-8 -*- import torch import math dtype = torch . float device = torch . device ( "cpu" ) # device = torch.device("cuda:0") # Uncomment this to run on GPU # Create Tensors to hold input and outputs.