Tensor.cuda() doesn't work

I have a weird issue with tensor.cuda(), it seems as if it doesn’t always work:

self.returns = torch.zeros(self.step, 1, 1)
self.returns = self.retruns.cuda()
rewards = rewards.cuda()
masks = masks.cuda()
print(self.returns.type(), rewards.type(), masks.type())
--output: torch.FloatTensor torch.cuda.FloatTensor torch.cuda.FloatTensor

does anyone know what might be the issue?

Typo in the given line:

self.returns = self.retruns.cuda()

It was even more stupid than that, instead of doing self.returns = self.retruns.cuda() I just did self.returns.cuda() and didn’t understand why nothing has changed.