I would like to know the correct way to write a module that will avoid RuntimeError: Expected all tensors to be on the same device.  (I am using torch.jit.script if this is important)
I recently asked a related question about the .to(device) function and was helpfully told that “valid members for this operation is other nn.Modules, Parameters and Buffers”.  What should you do with other kinds of data?
Here is an illustration of what I would like to do:
class TestModule(nn.Module):

    def __init__(self, net, param_float, param_tensor):
        super().__init__()
        self.net = net
        self.tensor_ = nn.Parameter(param_tensor)
        self.float_ = nn.Parameter(torch.tensor(param_float))
        self.tuple_of_tuples_ = ((1, 4), (1, 5))
        self.tensor_list_ = []
        
    def forward(self, x):
        # something that uses all module attributes


Many thanks!