Skip to content
Snippets Groups Projects
  • Guy Jacob's avatar
    db531db8
    DistillerModuleList conversion: Handle models w. duplicate modules (#338) · db531db8
    Guy Jacob authored
    * By duplicate modules we mean:
      self.relu1 = nn.Relu()
      self.relu2 = self.relu1
    * The issue:
      The second module ('relu2') will not be returned by
      torch.nn.Module.named_modules/children()
    * When converting to DistillerModuleList, in order to maintain the
      original order of modules and in order to have a correct mapping
      of names before/after the conversion - we need to take the duplicates
      into account
    * Implemented an internal version of named_modules/children that includes
      duplicates
    * Added test case for this + refactored the module list conversion tests
    DistillerModuleList conversion: Handle models w. duplicate modules (#338)
    Guy Jacob authored
    * By duplicate modules we mean:
      self.relu1 = nn.Relu()
      self.relu2 = self.relu1
    * The issue:
      The second module ('relu2') will not be returned by
      torch.nn.Module.named_modules/children()
    * When converting to DistillerModuleList, in order to maintain the
      original order of modules and in order to have a correct mapping
      of names before/after the conversion - we need to take the duplicates
      into account
    * Implemented an internal version of named_modules/children that includes
      duplicates
    * Added test case for this + refactored the module list conversion tests