Solved by imbibekk in post #2 
              
              
                Try this! 
import torch
import math

class CustAct(torch.nn.Module):
    def __init__(self, degree=4, alphas=None):
        super(CustAct, self).__init__()
        if alphas:
            self.alphas = torch.nn.Parameter(torch.Tensor(alphas))
        else:
            self.alphas = torch.nn.Parameter…