How to define my own parameter which can be learned?

I know how to define conv parameter or fc parameter. Now, I want to define a parameter matrix W×H, and it can be learned like conv parameter. How can I do this?
Thank you for your attention and answer!

You can register parameters in your model with nn.Parameter.
Alternatively, if you would like to train your parameter outside of a model, you could just use torch.randn(..., requires_grad=True). You can find an example here.

Thank you very much.