This code shows you how to find linear regression using PyTorch. You can kindly find the posts related to this code at the following links:
A Smooth Introduction to Linear Regression and its Implementation in PyTorch (Part-I)
A Smooth Introduction to Linear Regression and its Implementation in PyTorch (Part-II)