def fmha_style_b2b_bmm_gen_function_call(func_attrs, indent="  "):
    """the function for generating a function call for attention"""
    assert len(func_attrs["outputs"]) == 1, f"{len(func_attrs['outputs'])=} != 1"
    assert len(func_attrs["inputs"]) in (
        3,
        4,
    ), f"{len(func_attrs['inputs'])=} != 3 or 4"

    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"]

    bias_name = "nullptr"
    if len(func_attrs["inputs"]) == 4:
        bias_name = func_attrs["inputs"][3]._attrs["name"]

    q_shape = func_attrs["inputs"][0]._attrs["shape"]
    k_shape = func_attrs["inputs"][1]._attrs["shape"]
    batch_size = q_shape[0]._attrs["name"]
    seq_length = q_shape[1]._attrs["name"]
    seq_length_kv = k_shape[1]._attrs["name"]
    num_heads = q_shape[2]._attrs["name"]

    return FUNC_CALL_TEMPLATE.render(
        func_name=func_attrs["name"],
        output=output_name,
        query=q_name,
        key=k_name,
        value=v_name,
        bias=bias_name,
        accum_ptr="global_workspace_",
        batch_size=batch_size,
        seq_length=seq_length,
        seq_length_kv=seq_length_kv,
        num_heads=num_heads,
        indent=indent,
    )
the function for generating a function call for attention
python/aitemplate/backend/cuda/b2b_bmm/fmha_style_b2b_bmm.py