I mean, how can I get rid of .to()? Is it a way to tell PyTorch or Lightning that my class is just an aggregation of tensors so then they can just automatically implement and call .to() for me? I was expecting something like this
class TensorGroup(torch.TensorAggregation):
     def __init__(self):
        super().__init__()
        self.tensor1 = torch.rand()
        self.tensor2 = torch.rand()

# in a Lightning training step
def training_step(self,batch, batch_idx):
    some_tensor_group = TensorGroup().to(self.device) # which is the same as some_tensor = torch.rand(1).to(self.device)
    # or even better
    some_tensor_group = TensorGroup() # so I can get rid of .to()