docstr: Build the cat padding dependencies.
  If the output features of several layers are stitched together
  by cat operation, then these layers have cat padding dependencies.
  This is because when inferring the cat mask, we need all the input
  masks for the cat operation. At this time we need to know the source
  of all input vectors of a cat operation.
docstr_tok: ["Build","the","cat","padding","dependencies",".","If","the","output","features","of","several","layers","are","stitched","together","by","cat","operation",",","then","these","layers","have","cat","padding","dependencies",".","This","is","because","when","inferring","the","cat","mask",",","we","need","all","the","input","masks","for","the","cat","operation",".","At","this","time","we","need","to","know","the","source","of","all","input","vectors","of","a","cat","operation","."]
code: def build_dependency(self):
      """
      Build the cat padding dependencies.
      If the output features of several layers are stitched together
      by cat operation, then these layers have cat padding dependencies.
      This is because when inferring the cat mask, we need all the input
      masks for the cat operation. At this time we need to know the source
      of all input vectors of a cat operation.
      """
      for node in self.graph.nodes_py.nodes_op:
          parent_layers = []
          if node.op_type == CAT_TYPE:
              parent_layers = self._get_parent_layers(node)
              dependency_set = set(parent_layers)
              # merge the dependencies
              for parent in parent_layers:
                  if parent in self.dependency:
                      dependency_set.update(self.dependency[parent])
              # save the dependencies
              for _node in dependency_set:
                  self.dependency[_node] = dependency_set
  
imports: import csv
  import logging
label_desc: Use image node_id 2 for calling the CatPaddingDependency obj's underlying member method code with example usage: obj.build_dependency() without return types