class_docstr: Class to represent node in Markov decision process. A stage has states
  to represent different schedules of the current node. Since in this problem
  the action is the schedule selected for current node, action can be fully
  represented by states. No extra attribute needs for action.
  
  In most cases, instance of this class should be created through DPTuner.
class_docstr_tok: ["Class","to","represent","node","in","Markov","decision","process",".","A","stage","has","states","to","represent","different","schedules","of","the","current","node",".","Since","in","this","problem","the","action","is","the","schedule","selected","for","current","node",",","action","can","be","fully","represented","by","states",".","No","extra","attribute","needs","for","action",".","In","most","cases",",","instance","of","this","class","should","be","created","through","DPTuner","."]
docstr: Initialize a stage and create all states.
  
  Parameters
  ----------
  idx : int
      Index for current node.
  
  input_shapes : dict of string to tuple of int
      Input shapes for current graph.
  
  node_list : list of dict
      List of all nodes for current graph.
  
  counted_nodes_set : set of int
      Global set recording whether the execution time of a node has been counted.
  
  layout_transform_interlayer_cost : dict of tuple to list
      Dictionary maps node index pair to layout transformation time between them.
  
  stage_dict : dict of int to Stage
      Global dictionary for all stages mapping node index to stage.
  
  in_nodes_dict : dict of int to list of int
      Dictionary maps node index to corresponding input node index.
  
  out_nodes_dict : dict of int to list of int
      Dictionary maps node index to corresponding output node index.
  
  dep_dict : dict of int to set of int
      Dictionary maps node index to dependent node index.
  
  target_ops : list of str
      Target operators
  
  dtype : str, optional
      Data type.
docstr_tok: ["Initialize","a","stage","and","create","all","states",".","Parameters","--","--","--","--","--","idx",":","int","Index","for","current","node",".","input_shapes",":","dict","of","string","to","tuple","of","int","Input","shapes","for","current","graph",".","node_list",":","list","of","dict","List","of","all","nodes","for","current","graph",".","counted_nodes_set",":","set","of","int","Global","set","recording","whether","the","execution","time","of","a","node","has","been","counted",".","layout_transform_interlayer_cost",":","dict","of","tuple","to","list","Dictionary","maps","node","index","pair","to","layout","transformation","time","between","them",".","stage_dict",":","dict","of","int","to","Stage","Global","dictionary","for","all","stages","mapping","node","index","to","stage",".","in_nodes_dict",":","dict","of","int","to","list","of","int","Dictionary","maps","node","index","to","corresponding","input","node","index",".","out_nodes_dict",":","dict","of","int","to","list","of","int","Dictionary","maps","node","index","to","corresponding","output","node","index",".","dep_dict",":","dict","of","int","to","set","of","int","Dictionary","maps","node","index","to","dependent","node","index",".","target_ops",":","list","of","str","Target","operators","dtype",":","str",",","optional","Data","type","."]
code: def __init__(
      self,
      idx,
      input_shapes,
      node_list,
      counted_nodes_set,
      layout_transform_interlayer_cost,
      stage_dict,
      in_nodes_dict,
      out_nodes_dict,
      dep_dict,
      target_ops,
      dtype="float32",
  ):
      """Initialize a stage and create all states.
  
      Parameters
      ----------
      idx : int
          Index for current node.
  
      input_shapes : dict of string to tuple of int
          Input shapes for current graph.
  
      node_list : list of dict
          List of all nodes for current graph.
  
      counted_nodes_set : set of int
          Global set recording whether the execution time of a node has been counted.
  
      layout_transform_interlayer_cost : dict of tuple to list
          Dictionary maps node index pair to layout transformation time between them.
  
      stage_dict : dict of int to Stage
          Global dictionary for all stages mapping node index to stage.
  
      in_nodes_dict : dict of int to list of int
          Dictionary maps node index to corresponding input node index.
  
      out_nodes_dict : dict of int to list of int
          Dictionary maps node index to corresponding output node index.
  
      dep_dict : dict of int to set of int
          Dictionary maps node index to dependent node index.
  
      target_ops : list of str
          Target operators
  
      dtype : str, optional
          Data type.
      """
      self._global_input_shapes = input_shapes
      self._global_input_names = input_shapes.keys()
      self._global_node_list = node_list
      self._global_counted_nodes_set = counted_nodes_set
      self._global_layout_transform_interlayer_cost = (
          layout_transform_interlayer_cost
      )
      self._global_stage_dict = stage_dict
      self._global_in_nodes_dict = in_nodes_dict
      self._global_out_nodes_dict = out_nodes_dict
      self._global_dep_dict = dep_dict
  
      self._idx = idx
      self._node_entry = self._global_node_list[idx]
      self._target_ops = target_ops
      self._wkl = self._node_entry["workloads"][0]
      self._record_list = self._node_entry["record_candidates"]
      self._dep = []
      self._dtype = dtype
      self._states = None
      self._full_states = None
      self._full_states_idx = None
      self._create_states()
  
file_path: tvm/python/tvm/autotvm/graph_tuner/dynamic_programming_stage.py
imports: import numpy
  from .utils import is_boundary_node
label_desc: Use image node_id 1 to create a new DPStage object from inherited base classes: object with example: obj = DPStage(idx, input_shapes, node_list, counted_nodes_set, layout_transform_interlayer_cost, stage_dict, in_nodes_dict, out_nodes_dict, dep_dict, target_ops, dtype)