class_docstr: Rename outputs according to mapping
class_docstr_tok: ["Rename","outputs","according","to","mapping"]
code: def __call__(self, graph):  # type: (Graph) -> Graph
      mapping = self.mapping.copy()
      nodes = graph.nodes
      for node in nodes:
          for i in range(len(node.outputs)):
              output = node.outputs[i]
              if output not in mapping:
                  continue
              node.outputs[i] = mapping[output]
              for child in node.children:
                  for j in range(len(child.inputs)):
                      input_ = child.inputs[j]
                      if input_ != output:
                          continue
                      child.inputs[j] = mapping[output]
              del mapping[output]
              if len(mapping) == 0:
                  break
      return graph
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  from typing import Sequence, Text, Dict, List
  import numpy
  from onnx import TensorProto
  from ._graph import Graph, Node
label_desc: Use image node_id 2 for calling the OutputRenamer obj's underlying member method code with example usage: obj.__call__(graph) and returns: graph