The usage of the .data attribute is not recommended, as it might have side effects, such as wrong gradient calculation.
If you want to set w_modfd as the filter kernels for dummy_conv, you could assign it as a new nn.Parameter outside of the loop.