class_docstr: An approximation method to deal with intractably
  large size of graph tuning problem.
  
  This graph coloring algorithm mainly comes from:
  
  Lang Hames and Bernhard Scholz.
  Nearly optimal register allocation with pbqp.JMLC 2006.
  LNCS, vol.4228,pp. 346-361, 2016
class_docstr_tok: ["An","approximation","method","to","deal","with","intractably","large","size","of","graph","tuning","problem",".","This","graph","coloring","algorithm","mainly","comes","from",":","Lang","Hames","and","Bernhard","Scholz",".","Nearly","optimal","register","allocation","with","pbqp.JMLC","2006",".","LNCS",",","vol.4228",",","pp",".","346-361",",","2016"]
docstr: Create a partitioned boolean quadratic programming tuner.
docstr_tok: ["Create","a","partitioned","boolean","quadratic","programming","tuner","."]
code: def __init__(self, *args, **kwargs):
      """Create a partitioned boolean quadratic programming tuner."""
      super(PBQPTuner, self).__init__(*args, **kwargs)
  
      # Remove input and ruled_out nodes
      input_names = self._input_shapes.keys()
      for node_idx in self._out_nodes_dict:
          node = self._node_list[node_idx]
          if is_boundary_node(node, input_names):
              for out_node_idx in self._out_nodes_dict[node_idx]:
                  self._in_nodes_dict[out_node_idx].remove(node_idx)
  
      self._adj_dict = {}
      for node_idx in self._in_nodes_dict:
          self._adj_dict[node_idx] = list(
              self._in_nodes_dict[node_idx]
          ) + list(self._out_nodes_dict[node_idx])
  
      self._record_cost_dict = {}
      for key in self._in_nodes_dict:
          self._record_cost_dict[key] = []
          for record in self._node_list[key]["record_candidates"]:
              self._record_cost_dict[key].append(record[1].costs[0])
  
      self._max_degree = -1
      self._node_degree_dict = {}
      for node_idx in self._in_nodes_dict:
          node_degree = self._get_degree(node_idx)
          self._node_degree_dict[node_idx] = node_degree
          self._max_degree = max(self._max_degree, node_degree)
  
      self._stack = []
      self._buckets = [[] for _ in range(self._max_degree + 2)]
      for node_idx in sorted(self._in_nodes_dict):
          node_degree = self._get_degree(node_idx)
          self._buckets[node_degree].append(node_idx)
  
      self._is_optimal = True
  
file_path: tvm/python/tvm/autotvm/graph_tuner/pbqp_tuner.py
imports: from ._base import INVALID_LAYOUT_TIME
  from .base_graph_tuner import BaseGraphTuner
  from .utils import is_boundary_node, has_multiple_inputs
label_desc: Use image node_id 1 to create a new PBQPTuner object from inherited base classes: BaseGraphTuner with example: obj = PBQPTuner()