parameters: (self, output_node_names)
return_statement: return self.output_graph
docstring: Triggers rewriting of the float graph.
  
      Args:
        output_node_names: A list of names of the nodes that produce the final
          results.
  
      Returns:
        A quantized version of the float graph.
docstring_summary: Triggers rewriting of the float graph.
docstring_tokens: Triggers rewriting of the float graph .
function: def rewrite(self, output_node_names):
      """Triggers rewriting of the float graph.
  
      Args:
        output_node_names: A list of names of the nodes that produce the final
          results.
  
      Returns:
        A quantized version of the float graph.
      """
      self.output_graph = tf.GraphDef()
      output_nodes = [self.nodes_map[output_node_name]
                      for output_node_name in output_node_names]
      if self.mode == "round":
        self.already_visited = {}
        for output_node in output_nodes:
          self.round_nodes_recursively(output_node)
      elif self.mode == "quantize":
        self.already_visited = {}
        self.already_quantized = {}
        for output_node in output_nodes:
          self.quantize_nodes_recursively(output_node)
      elif self.mode == "eightbit":
        self.set_input_graph(self.remove_unneeded_nodes(self.input_graph))
        self.already_visited = {}
        self.layers_eightbitized = []
        for output_node in output_nodes:
          self.eightbitize_nodes_recursively(output_node)
        self.output_graph = self.quantize_weights(self.output_graph, b"MIN_FIRST")
        if FLAGS.strip_redundant_quantization:
          self.output_graph = self.remove_redundant_quantization(
              self.output_graph)
          self.remove_dead_nodes(output_node_names)
      elif self.mode == "weights":
        self.output_graph = self.quantize_weights(self.input_graph,
                                                  b"MIN_COMBINED")
        self.remove_dead_nodes(output_node_names)
      elif self.mode == "weights_rounded":
        self.output_graph = self.quantize_weights(self.input_graph, self.mode)
        self.remove_dead_nodes(output_node_names)
      else:
        print("Bad mode - " + self.mode + ".")
      return self.output_graph
function_tokens: def rewrite ( self , output_node_names ) : self . output_graph = tf . GraphDef ( ) output_nodes = [ self . nodes_map [ output_node_name ] for output_node_name in output_node_names ] if self . mode == "round" : self . already_visited = { } for output_node in output_nodes : self . round_nodes_recursively ( output_node ) elif self . mode == "quantize" : self . already_visited = { } self . already_quantized = { } for output_node in output_nodes : self . quantize_nodes_recursively ( output_node ) elif self . mode == "eightbit" : self . set_input_graph ( self . remove_unneeded_nodes ( self . input_graph ) ) self . already_visited = { } self . layers_eightbitized = [ ] for output_node in output_nodes : self . eightbitize_nodes_recursively ( output_node ) self . output_graph = self . quantize_weights ( self . output_graph , b"MIN_FIRST" ) if FLAGS . strip_redundant_quantization : self . output_graph = self . remove_redundant_quantization ( self . output_graph ) self . remove_dead_nodes ( output_node_names ) elif self . mode == "weights" : self . output_graph = self . quantize_weights ( self . input_graph , b"MIN_COMBINED" ) self . remove_dead_nodes ( output_node_names ) elif self . mode == "weights_rounded" : self . output_graph = self . quantize_weights ( self . input_graph , self . mode ) self . remove_dead_nodes ( output_node_names ) else : print ( "Bad mode - " + self . mode + "." ) return self . output_graph