Hi guys,
How efficient is the following?
rewards = torch.as_tensor(rewards).to(self.device).float()

vs
rewards = torch.as_tensor(rewards).float().to(self.device)

What is the best way to benchmark that given all the randomness with GPU?
Lastly, if a tensor x on the GPU is already a float and then applying another x = x.float() operation - is that efficient? In other words, does PyTorch know it’s already float and will not do the cast? Or does that result in a significant overhead that should be avoided?
Thanks!