The cuda() method is defined for tensors, while it seems you are calling it on a numpy array.
Try to transform the numpy array to a tensor before calling tensor.cuda() via: tensor = torch.from_numpy(array).