class_docstr: A floder to fold a graph' nodes which has same scope into one node.
class_docstr_tok: ["A","floder","to","fold","a","graph","'","nodes","which","has","same","scope","into","one","node","."]
code: def check_weights(self):
      weight_related_ops = ["FullyConnected"]
      pattern_weight_op = collections.OrderedDict()
      name_no_dict = collections.OrderedDict()
      pattern_weights = collections.OrderedDict()
  
      for ir_node_name in self._graph.topological_sort:
          ir_node = self._graph.get_node(ir_node_name)
          if ir_node.type == "Scope":
              for inner_name in ir_node.topology_list:
                  if (
                      self._graph.get_node(inner_name).type
                      in weight_related_ops
                  ):
                      if pattern_weight_op.get(ir_node.pattern, None):
                          if self._weights_dict[inner_name][
                              "weights"
                          ].any() and pattern_weights.get(
                              ir_node.pattern, None
                          ):
                              inner_weights = self._weights_dict[
                                  inner_name
                              ]["weights"]
                              isExist = False
                              for idx, it in enumerate(
                                  pattern_weights[ir_node.pattern]
                              ):
                                  if np.array_equal(
                                      inner_weights, it["weights"]
                                  ):
                                      ir_node.pattern = (
                                          ir_node.pattern
                                          + "_"
                                          + str(idx)
                                      )
                                      isExist = True
                                      break
                              if isExist:
                                  continue
                          pattern_weight_op[ir_node.pattern].add(
                              inner_name
                          )
                          pattern_weights[ir_node.pattern].append(
                              self._weights_dict[inner_name]
                          )
                          ir_node.pattern = (
                              ir_node.pattern
                              + "_"
                              + str(
                                  len(pattern_weights[ir_node.pattern])
                                  - 1
                              )
                          )
  
                      else:
                          pattern_weight_op[ir_node.pattern] = set(
                              [inner_name]
                          )
                          if self._weights_dict.get(inner_name, None):
                              pattern_weights[ir_node.pattern] = [
                                  self._weights_dict[inner_name]
                              ]
                              ir_node.pattern = (
                                  ir_node.pattern
                                  + "_"
                                  + str(
                                      name_no_dict.get(
                                          ir_node.pattern, 0
                                      )
                                  )
                              )
  
file_path: MMdnn/mmdnn/conversion/rewriter/folder.py
imports: from mmdnn.conversion.common.IR.IR_graph import *
  import sys
  import re
  import numpy
  import collections
label_desc: Use image node_id 12 for calling the Folder obj's underlying member method code with example usage: obj.check_weights() without return types