def mem_eff_attention_gen_function_call(func_attrs, indent="  "):
    """the function for generating a function call for attention"""
    assert len(func_attrs["outputs"]) == 1
    assert len(func_attrs["inputs"]) in [4, 5]

    output_name = func_attrs["outputs"][0]._attrs["name"]

    q_name = func_attrs["inputs"][0]._attrs["name"]
    k_name = func_attrs["inputs"][1]._attrs["name"]
    v_name = func_attrs["inputs"][2]._attrs["name"]

    seqlens_name = FUNC_CALL_INT32_PARAM_TEMPLATE.render(
        name=func_attrs["inputs"][3]._attrs["name"]
    )

    q = func_attrs["inputs"][0]

    batch_size = func_attrs["inputs"][3].shape()[0]._attrs["name"]
    num_heads = q._attrs["shape"][1]._attrs["values"][0]
    max_seqlen = q._attrs["shape"][0].upper_bound() // 16
    head_dim = q._attrs["shape"][3]._attrs["values"][0]

    softmax_scale = head_dim ** (-0.5)

    return FUNC_CALL_TEMPLATE.render(
        func_name=func_attrs["name"],
        output=output_name,
        q=q_name,
        k=k_name,
        v=v_name,
        seqlens=seqlens_name,
        max_seqlen=max_seqlen,
        batch_size=batch_size,
        num_heads=num_heads,
        head_dim=head_dim,
        softmax_scale=softmax_scale,
        indent=indent,
    )
the function for generating a function call for attention
python/aitemplate/backend/rocm/attention/mem_eff_attention.py