I started using pytorch recently, I’m forced to use version 0.3.0, I created a network that works on CPU, now I would like to try on GPU, I read in the documentation that I should use " model.to (device) ", device for example cuda: 0, but this gave me an error " MyModel: object has no attribute to ", so I tried like this:
model = MyNet(N_CHANNEL, H_STATE, N_LAYERS, BIDIRECTIONAL, N_CATEGORIES).cuda
optimizer = torch.optim.Adam(model.parameters(), lr=LEARNING_RATE)

But I can not fix this error:
AttributeError: 'function' object has no attribute 'parameters'
Can someone help me?
Thank you