Hi, I am a starter of Pytorch. I want to implement a multi-wavelet function as an activation function. However, I don’t know how to set a function in this module.
`class MultiWavelet(nn.Module):
def __init__(self,out_features):
    super(MultiWavelet, self).__init__()
    self.out_features = out_features
    self.scale = nn.Parameter(torch.Tensor(1,self.out_features),requires_grad = True)
    self.shift = nn.Parameter(torch.Tensor(1,self.out_features),requires_grad = True)
    self.a = nn.Parameter(torch.Tensor(1,self.out_features),requires_grad = True)
    self.b = nn.Parameter(torch.Tensor(1,self.out_features),requires_grad = True)
    
def func1(self,c):
    self.c = c
    out = self.c.detach().numpy().copy()
    out[out>=0 & out <1] = -2 * torch.pow(out,3) + 3 * torch.pow(out,2)
    out[out>=1 & out <=2] = torch.pow((2-out),2) * (2*out - 1)
    out[out <0 & out>2] = 0
    return out
    

def Wavelet2(self,c):
    self.c = c
    out = self.c.detach().numpy().copy()
    out[out>=0 & out <1] = -torch.pow(out,2) * (3 * out - 3)
    out[out>=1 & out <=2] = -torch.pow((2-out),2) * (3* out - 3)
    out[out <0 & out>2] = 0
    return out

def forward(self, x):
    x_out = (x-self.shift)/self.scale
    h1 = self.Wavelet1(x_out)
    h2 = self.Wavelet(x_out)
    h = a. * h1 + b. * h2
    
    return h`

In this case, I get a runtime error.That is TypeError: pow() received an invalid combination of arguments - got (numpy.ndarray, int), but expected one of:

(Tensor input, Tensor exponent, Tensor out)
(Number self, Tensor exponent, Tensor out)
(Tensor input, Number exponent, Tensor out)

Thank you all in advance.