I think we can do experiments to test and get the result (the constant) using this code, here the example is tanh():
x = torch.randn(10000)
out = torch.tanh(x)

gain = x.std() / out.std()
print('gain:{}'.format(gain))