def METHOD_NAME(stmt, layout):
    """Get the outer loops of an operator.
    Parameters
    ----------
    stmt : tvm.tir.For
        The outermost loop.
    layout : str
        The output tensor layout (NHWC or NHCWB16).
    Returns
    -------
    n : tvm.tir.For
        The batch loop.
    h : tvm.tir.For
        The height loop.
    w : tvm.tir.For
        The width loop.
    c : tvm.tir.For
        The channels loop.
    b : tvm.tir.For
        The brick loop. None for NHWC
    body : tvm.tir.Stmt
        The inner body of the loops.
    """
    if layout == "NHWC":
        n = stmt
        h = n.body
        w = h.body
        c = w.body
        b = tvm.tir.For(tvm.tir.Var("b", "int32"), 0, 0, 0, tvm.tir.Evaluate(0))
        return n, h, w, c, b, c.body
    if layout == "NHCWB16":
        n = stmt
        h = n.body
        cb = h.body
        w = cb.body
        b = w.body
        return n, h, w, cb, b, b.body
    return None