code: def split(node, stack):
    
    node, defined, reaching = _fix(node)
  
    # Store and restore the state
    node = store_state(node, reaching, defined, stack)
  
    # Clean up
    anno.clearanno(node)
    return node
docs: Carry over the state from the primal to the adjoint.
  
    Args:
      node: A module with the primal and adjoint function definitions as returned
          by `reverse_ad`.
      stack: The stack node to use for storing and restoring state.
  
    Returns:
      func: A `Module` node with two function definitions containing the primal
          and adjoint respectively.