title: Function of Activation functions
body: <p>is it possible to define a function of activation function? I tried to do :</p>
  <pre><code>def activation():
      # return nn.Sin()
      # return nn.Tanh()
      # return nn.Sigmoid()
      # return nn.Tanhshrink()
      return nn.HardTanh(-1,1)
      # return nn.Hardswish()
      # return nn.functionnal.silu()
  </code></pre>
  <p>But i get an error when trying to call it. Here is an example:</p>
  <pre><code>def f():
    return nn.Tanh()
  input = torch.randn(2)
  output = f(input)
  print(output)
  </code></pre>
  <p>it outputs &quot;TypeError: f() takes 0 positional arguments but 1 was given&quot;. It doesn't work even i gave it an argument x.</p>