Hi,
I am new to pytorch, currently fighting with an issue but could not solve it so far. I have written a simple linear regression problem in pytorch. Here are the files in github:

simple training loop 3

The model can be found in the same directory in the models.py file.
When training if I use cuda after few epochs I am getting the Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)  in a debian based machine. But the code runs fine when running on CPU here is the file in github. Does any one know where is the problem. I am using python 3.8.0 and torch 1.8.1+cu111 
Thanks