Best way to change model submodule

Hello, I am wondering wich of these two ways is the best for changing a module’s submodule:

Here I want to change model’s “conv” module to a new convolution (different in and out sizes)

with torch.no_grad():
    new_conv = nn.Conv2d(...)
    W = nn.Parameter(new_conv.weight, requires_grad=True)
    model.conv1.weight = W
with torch.no_grad():
    new_conv = nn.Conv2d(...)
    model.conv1 = new_conv

Are both ways equivalent or there’s a better one? (in the case that none of the convolutions have a bias)

The approaches would be a bit different, since the first one would only reassign the weight parameter and keep all other attributes of model.conv1 equal (stride, dilation, groups, etc.), while the latter one would reassign the entire module with all its attributes.