class_docstr: Helper class to manage calculating and caching control_outputs in graph.
class_docstr_tok: ["Helper","class","to","manage","calculating","and","caching","control_outputs","in","graph","."]
docstr: Returns the map of control_outputs for a given graph.
  
  Args:
    graph: The graph to parse.
  
  Returns:
    A map of the control outputs.
docstr_tok: ["Returns","the","map","of","control_outputs","for","a","given","graph",".","Args",":","graph",":","The","graph","to","parse",".","Returns",":","A","map","of","the","control","outputs","."]
code: def calc_control_outputs(self, graph):
      """Returns the map of control_outputs for a given graph.
  
      Args:
        graph: The graph to parse.
  
      Returns:
        A map of the control outputs.
      """
      control_outputs = {}
      for op in graph.get_operations():
          for control_input in op.control_inputs:
              if control_input not in control_outputs:
                  control_outputs[control_input] = set()
              control_outputs[control_input].add(op)
      return control_outputs
  
file_path: tensorflow/tensorflow/python/framework/subscribe.py
imports: import contextlib
  import re
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import tf_logging
label_desc: Use image node_id 2 for calling the _ControlOutputCache obj's underlying member method code with example usage: obj.calc_control_outputs(graph) and returns: control_outputs