@staticmethod
def forward(ctx, x, dim=(- 1)):
    ctx.dim = dim
    ctx.save_for_backward(x)
    return x.logsumexp(dim=dim)
@staticmethod
def forward(ctx, x, dim=(- 1)):
    ctx.dim = dim
    ctx.save_for_backward(x)
    return x.logsumexp(dim=dim)