import copy


def get_output_tensors(sub_graph):
  """ Get all output tensor names of a sub_graph.

  Args:
    sub_graph: A SubGraph instance.

  Returns:
    A set contains all output tensor names of the sub_graph.
  """
  output_tensors = copy.deepcopy(sub_graph.output_ops)
  for name in sub_graph.output_subgraphs:
    output_tensors |= sub_graph.output_subgraphs[name]
  return output_tensors