I want to assign a weight to a specific layer

First, it is assumed that the MLP classifying MNIST is pre-trained.

I want to multiply a particular layer of this network by a weight.

For example, for a 3-layer MLP, we want to multiply the weight of the second layer by alpha.

How do I implement it?

Currently, I have implemented alpha with nn.Parameter. Then alpha is not training.