@albanD  Thank you for the solution in the last line a = torch.rand(10, requires_grad=True, device="cuda") !
How does this work for a torch.nn.Linear(in_features: int, out_features: int, bias: bool = True) when I want to create a tensor with the linear transformation?
Could you explain what should be altered in this example here to create the linear transformation tensor on CUDA?
>>> m = nn.Linear(20, 30)
>>> input = torch.randn(128, 20)
>>> output = m(input)