code: def apply_conditional_split_to_branch_outputs(
      branch_outputs, promote_constants=True
  ):
      """Apply splitting to the branch outputs. This may be necessary for DataNodes that are
      branch outputs but were not touched in that branch (for example that branch is no-op).
  
      Parameters
      ----------
      branch_outputs : tuple of DataNode
          Outputs of the branch
      promote_constants : bool, optional
          Whether to promote constants to cpu-based Constant op, by default True
  
      Returns
      -------
      tuple of DataNode
      """
      from nvidia.dali.types import Constant
  
      def apply_split(atom):
          if isinstance(atom, _DataNode):
              return apply_conditional_split(atom)
          elif promote_constants:
              # We assume that any return from the branch must be merged, so constants are promoted
              # to batches using constant op, and thus can be used in merge.
              constant_node = Constant(atom, device="cpu")
              register_data_nodes(constant_node)
              return apply_conditional_split(constant_node)
          return atom
  
      return tree.map_structure(apply_split, branch_outputs)
  
imports: from nvidia.dali import _autograph
  from nvidia.dali.data_node import DataNode
  from nvidia.dali import fn
  from nvidia.dali._autograph.utils import ag_logging
  from nvidia.dali._autograph.operators import variables
  from contextlib import contextmanager
  from enum import Enum
  import tree
label_desc: Use image node_id 11 for calling a global function with example usage: apply_conditional_split_to_branch_outputs(branch_outputs, promote_constants) and returns: tree, atom, apply_conditional_split, apply_conditional_split