Alternative to nn.Mul (from Lua Torch)

I used to work with nn.Mul model to multiply a variable with a trainable scaler in Lua torch, but what is the right approach to do that in pytorch?
Is it:
a = nn.Parameter(torch.rand(1))
X = Variable(torch.rand(10))
X = a*X
Thanks

Yes, that looks correct