class_docstr: This model analyze the group dependencis between the conv
  layers in a model.
  
  Parameters
  ----------
  model : torch.nn.Module
      The model to be analyzed.
  dummy_input : 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.
class_docstr_tok: ["This","model","analyze","the","group","dependencis","between","the","conv","layers","in","a","model",".","Parameters","--","--","--","--","--","model",":","torch.nn.Module","The","model","to","be","analyzed",".","dummy_input",":","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","."]
docstr: Get the number of groups for a convolutional layer.
  Parameters
  ----------
  node_group : NodePyGroup
      target node.
  Returns
  -------
  group : int
      the number of the groups of the target conv layer.
docstr_tok: ["Get","the","number","of","groups","for","a","convolutional","layer",".","Parameters","--","--","--","--","--","node_group",":","NodePyGroup","target","node",".","Returns","--","--","--","-","group",":","int","the","number","of","the","groups","of","the","target","conv","layer","."]
code: def _get_conv_groups(self, node_group):
      """
      Get the number of groups for a convolutional layer.
      Parameters
      ----------
      node_group : NodePyGroup
          target node.
      Returns
      -------
      group : int
          the number of the groups of the target conv layer.
      """
      node_name = node_group.name
      leaf_module = get_nested_attr(self.model, node_name)
      assert isinstance(
          leaf_module, (torch.nn.Conv2d, torch.nn.ConvTranspose2d)
      )
      group = leaf_module.groups
      n_filter = leaf_module.out_channels
      if n_filter == group:
          # depthwise conv will not introduce extra group dependency
          return 1
      return group
  
imports: import csv
  import logging
  import torch
  import numpy
  from .attr import get_nested_attr
label_desc: Use image node_id 3 for calling the GroupDependency obj's underlying member method code with example usage: obj._get_conv_groups(node_group) and returns: group, int