If you would like to create new tensors inside forward, you should pass the device using the device of an already registered tensor:
...
reward = torch.zeros((1,), dtype=torch.float, device=self.num.device)