where should I change the code to tell PyTorch not to use the GPU?
As mentioned in How to tell PyTorch to not use the GPU?, in order to tell PyTorch not to use the GPU you should change a few lines inside PyTorch code.
Where should I make the change?
Where is the line of code that needs to be modified?
I tried to find it but couldn't...

Using the method .cpu() on any tensor or pytorch module transfers the component to the cpu so that the calculations will be made using it.
Another direction is to use the method .to(&quot;cpu&quot;). Alternatively, you can change &quot;cpu&quot; with the name of other devices such as &quot;cuda&quot;.
Example:
a)
model = MyModel().cpu()  # move the model to the cpu
x = data.cpu()  # move the input to the cpu
y = model(x)

b)
model = MyModel().to('cpu')  # move the model to the cpu
x = data.to('cpu')  # move the input to the cpu
y = model(x)

