Thankyou for the explanation,
but then how to do the following operation,
conv_shuffle.weight.copy_(kernel)

here  conv_shuffle is an instance of nn.Conv2d. I want to explicitly state its weights using kernel.
However, this results in the following error
conv_shuffle.weight.copy_(kernel)
RuntimeError: a leaf Variable that requires grad has been used in an in-place operation.

but is rectified using the following.
conv_shuffle.weight.data.copy_(kernel)

So now that .data is discouraged, what other alternative do I have?
Thankyou