You can load parameters via:
with torch.no_grad():
    model.layer.weight.copy_(custom_weight_tensor)

I don’t know exactly what “discard” layers means, but in case you want to remove them you could write a custom model and reuse other layers or replace them with nn.Identity assuming that the shapes of the activations would still match.