from this -> Implementation of SWISH : a self-gated activation function
Class Swish(Function):

    @staticmethod
    def forward(ctx, i):
        result = i*i.sigmoid()
        ctx.save_for_backward(result,i)
        return result

    @staticmethod
    def backward(ctx, grad_output):
        result,i = ctx.saved_variables
        sigmoid_x = i.sigmoid()
        return grad_output * (result+sigmoid_x*(1-result))

**swish= Swish.apply**

class Swish_module(nn.Module):
    def forward(self,x):
        return swish(x)
    
swish_layer = Swish_module()

Then, I received this
AttributeError                            Traceback (most recent call last)
<ipython-input-3-d633b4a504fd> in <module>()
     37         return grad_output * (result+sigm
oid_x*(1-result))
     38 
---> 39 swish= Swis
h.apply
     40 
     41 class Swish_module(nn.Module):

**AttributeError: type object 'Swish' has no attribute 'apply'**

So, I search from document then I can’t find apply method in Function.