How to make the Sine Wave example use CUDA?

Thank you so much for your help. Small note, it needed one more .cpu() in the last line

Needs to be:

y = pred.data.cpu().numpy()