def _get_mixed_jagged_dense_config(
    input_accessors: List[TensorAccessor],
    output_accessors: List[TensorAccessor],
) -> Tuple[bool, List[IntVar], bool]:
    """
    Returns Tuple(
        mixed_jagged_dense_indexing,
        output_volume,
        use_jagged_space_indexing,
    )
    """
    # all output shapes are assumed to be the same
    output_shape = output_accessors[0].original_shapes
    input_shapes = [acc.original_shapes for acc in input_accessors]
    jagged_input_shapes = [s for s in input_shapes if _is_jagged_shape(s)]
    dense_input_shapes = [s for s in input_shapes if not _is_jagged_shape(s)]

    if not jagged_input_shapes or not dense_input_shapes:
        # there are either only dense inputs or only jagged inputs:
        # in both cases all inputs will be treated as dense, because
        # the JaggedIntVars and ranks of all the jagged inputs are
        # assumed to be the same
        return False, None, False

    jagged_rank = len(jagged_input_shapes[0])
    max_dense_rank = max(len(s) for s in dense_input_shapes)

    if max_dense_rank <= jagged_rank - 1:
        # the longest dense shape does not overlap with the jagged dims:
        # the jagged inputs can be treated as dense, meaning that the
        # total_length of the jagged inputs (not overlapping with the
        # dense inputs' shapes) will be treated as a single dense dim
        return False, None, False

    jagged_int_var = output_shape[0]
    jagged_max_dense_prefix_shape = jagged_int_var.get_max_dense_shape()
    jagged_suffix_shape = output_shape[1:]
    output_volume = jagged_max_dense_prefix_shape + jagged_suffix_shape

    use_jagged_space_indexing = Target.current()._kwargs.get(
        "use_jagged_space_indexing", False
    )

    # because at least one of the dense inputs overlap with the
    # JaggedIntVar of the jagged inputs, jagged and dense inputs
    # will need different indexing in the generated kernel.
    # output_volume is the smallest rectangular volume fitting
    # all the input (jagged and dense) and outputs (jagged).
    return True, output_volume, use_jagged_space_indexing
Returns Tuple(
mixed_jagged_dense_indexing,
output_volume,
use_jagged_space_indexing,
)
python/aitemplate/backend/common/elementwise_common.py