You could slice the weight parameter and reassign it to the .weight attribute.
E.g. if you would like to keep the first 9 input features out of 10:
lin = nn.Linear(10, 5)
with torch.no_grad():
    lin.weight = nn.Parameter(lin.weight[:, :9])
    
x = torch.randn(2, 9)
output = lin(x)