def jagged_to_dense_gen_function(func_attrs: Dict[str, Any]) -> str:
    """Generates jagged_to_dense function definition."""

    vectors = func_attrs["inputs"][0]
    matrices = func_attrs["inputs"][1]
    backend_spec = CUDASpec()

    dtype = vectors.dtype()
    data_type = backend_spec.dtype_to_backend_type(dtype)

    kernel_function = _gen_kernel_function(
        func_attrs,
        backend_spec.index_type,
        data_type,
    )

    constant = CONSTANT_TEMPLATE.render()

    function = FUNC_TEMPLATE.render(
        prefix=backend_spec.prefix,
        index_type=backend_spec.index_type,
        head=backend_spec.header_src_template.render(),
        constant=constant,
        kernel_function=kernel_function,
        func_name=func_attrs["name"],
        offsets_decl=gen_offsets_str(
            matrices._attrs["shape"][0],
            has_type=True,
            # the offsets are passed
            # by const reference to the function
            const_ref=True,
            name="offsets",
        ),
        offsets_call=gen_offsets_str(
            matrices._attrs["shape"][0],
            has_type=False,
            const_ref=False,
            name="offsets",
        ),
        data_t=data_type,
    )
    return function
Generates jagged_to_dense function definition.
python/aitemplate/backend/cuda/gemm_special/batched_dense_vec_jagged_2d_mul.py