class_docstr: This model analyze the channel dependencies between the conv
  layers in a model.
  
  Parameters
  ----------
  model : torch.nn.Module
      The model to be analyzed.
  data : torch.Tensor
      The example input data to trace the network architecture.
  traced_model : torch._C.Graph
      if we alreay has the traced graph of the target model, we donnot
      need to trace the model again.
  prune_type: str
      This parameter indicates the channel pruning type: 1) `Filter`
      prune the filter of the convolution layer to prune the corresponding
      channels 2) `Batchnorm`: prune the channel in the batchnorm layer
class_docstr_tok: ["This","model","analyze","the","channel","dependencies","between","the","conv","layers","in","a","model",".","Parameters","--","--","--","--","--","model",":","torch.nn.Module","The","model","to","be","analyzed",".","data",":","torch.Tensor","The","example","input","data","to","trace","the","network","architecture",".","traced_model",":","torch._C.Graph","if","we","alreay","has","the","traced","graph","of","the","target","model",",","we","donnot","need","to","trace","the","model","again",".","prune_type",":","str","This","parameter","indicates","the","channel","pruning","type",":","1",")","`","Filter","`","prune","the","filter","of","the","convolution","layer","to","prune","the","corresponding","channels","2",")","`","Batchnorm","`",":","prune","the","channel","in","the","batchnorm","layer"]
docstr: Find the nearest father conv layers for the target node.
  Parameters
  ---------
  node : torch._C.Node
      target node.
  Returns
  -------
  parent_layers: list
      nearest father conv/linear layers for the target worknode.
docstr_tok: ["Find","the","nearest","father","conv","layers","for","the","target","node",".","Parameters","--","--","--","--","-","node",":","torch._C.Node","target","node",".","Returns","--","--","--","-","parent_layers",":","list","nearest","father","conv\/linear","layers","for","the","target","worknode","."]
code: def _get_parent_layers(self, node):
      """
      Find the nearest father conv layers for the target node.
      Parameters
      ---------
      node : torch._C.Node
          target node.
      Returns
      -------
      parent_layers: list
          nearest father conv/linear layers for the target worknode.
      """
  
      parent_layers = []
      queue = []
      queue.append(node)
      visited_set = set()
      while queue:
          curnode = queue.pop(0)
          if curnode in visited_set:
              continue
          visited_set.add(curnode)
          if curnode.op_type in self.target_types:
              # find the first met conv
              parent_layers.append(curnode.name)
              continue
          elif curnode.op_type in RESHAPE_OPS:
              if reshape_break_channel_dependency(curnode):
                  continue
          parents = self.graph.find_predecessors(curnode.unique_name)
          parents = [self.graph.name_to_node[name] for name in parents]
          for parent in parents:
              if parent in visited_set:
                  continue
              queue.append(parent)
  
      return parent_layers
  
imports: import csv
  import logging
  import torch
  import numpy
  from .attr import get_nested_attr
label_desc: Use image node_id 2 for calling the ChannelDependency obj's underlying member method code with example usage: obj._get_parent_layers(node) and returns: parent_layers