def METHOD_NAME(images: Tensor, network: nn.Module, keys: list[str] | None = None) -> list[Tensor]:
    """
    Decompose the output of network (a dict) into a list.
    Args:
        images: input of the network
        keys: the keys in the network output whose values will be output in this func.
            If not provided, will use all keys.
    Return:
        network output values concat to a single List[Tensor]
    """
    head_outputs = network(images)
    # if head_outputs is already a sequence of tensors, directly output it
    if isinstance(head_outputs, (tuple, list)):
        return list(head_outputs)
    # if head_outputs is a dict
    ensure_dict_value_to_list_(head_outputs, keys)
    if keys is None:
        keys = list(head_outputs.keys())
    check_dict_values_same_length(head_outputs, keys)
    head_outputs_sequence = []
    for k in keys:
        head_outputs_sequence += list(head_outputs[k])
    return head_outputs_sequence