Error executing Pytorch on Colab

Hi,

The error is because you give to an optimizer tensors that do not require gradients. It cannot optimize them.
This has already been answered here for example.