The nested loop would be slow, but should generally work as a first experiment.
In your code it seems you are copying the result to an nn.Parameter, which sounds wrong and you should create a new output tensor instead.
A faster approach would be to use unfold and to apply a matrix multiplication to calculate the convolution. The nn.Unfold docs give you an example.