@AruniRC
In fact, one can easily use the built-in pytorch functional.
class ScaleLayer(nn.Module):

   def __init__(self, init_value=1e-3):
       super().__init__()
       self.scale = nn.Parameter(torch.FloatTensor([init_value]))

   def forward(self, input):
       return input * self.scale

(I edited the example slightly --@colesbury)