Try the following Gamma layer:
class Gamma(nn.Module):
    def __init__(self, eps=1e-8):
        super().__init__()
        self.eps = eps
        self.gamma = nn.Parameter(torch.tensor(1.))
    
    def forward(self, input):
        return input.sign() * (input.abs() + self.eps)**self.gamma

There are two tricks here. The first is to handle negative inputs by odd symmetry 4; f(-x) is computed as -f(x). The second is to handle zero or close-to-zero inputs by adding a small ‘epsilon’ value to ensure numerical stability.
I tested this layer and was able to get it to train whereas without these tricks the self.gamma parameter would end up NaN.