In case anyone else is interested, the closest solution I was able to find involves using
torch.nn.utils.parameters_to_vector() to get the parameters vector and then calling torch.nn.utils.vector_to_parameters() when I’m done modifying it.