def _is_last_reduction_dim(func_attrs):
    """return true if the reduction dim is the last dim (i.e. inner most dim)"""
    axes = func_attrs["reduction_axes"]
    if not len(axes) == 1:
        raise NotImplementedError("Multiple reduction axes are not supported yet")
    reduction_dim = axes[0]
    # make sure our frontend handle negative dims
    assert reduction_dim >= 0, "cannot have negative dim here: {}".format(reduction_dim)
    x = func_attrs["inputs"][0]
    rank = x._rank()
    assert rank >= 1, "rank must >= 1, got: {}".format(rank)
    return reduction_dim == rank - 1
return true if the reduction dim is the last dim (i.e. inner most dim)
python/aitemplate/backend/cuda/reduce/reduce_sum.py