It depends on the actual use case, but instead of e.g. using an nn.Linear module, you would manually create the parameters and use the functional API or the corresponding torch methods:
device = 'cuda'
x = torch.randn(1, 10).to(device)

# module
lin = nn.Linear(10, 10, bias=False).to(device)
out = lin(x)

# functional API
w = nn.Parameter(torch.randn(10, 10, device=device))
out = F.linear(x, w)

# torch methods
out = torch.matmul(x, w.T)