@staticmethod
def forward(ctx, inp, axis=None):
    axis = ([axis] if (type(axis) == int) else axis)
    ret = np.amax(inp, axis=(None if (axis is None) else tuple(axis)), keepdims=True)
    ctx.save_for_backward(inp, axis, ret)
    if (axis is not None):
        ret = ret.reshape([inp.shape[i] for i in range(len(inp.shape)) if (i not in axis)])
    return ret
@staticmethod
def forward(ctx, inp, axis=None):
    axis = ([axis] if (type(axis) == int) else axis)
    ret = np.amax(inp, axis=(None if (axis is None) else tuple(axis)), keepdims=True)
    ctx.save_for_backward(inp, axis, ret)
    if (axis is not None):
        ret = ret.reshape([inp.shape[i] for i in range(len(inp.shape)) if (i not in axis)])
    return ret