class_docstr: Only ``kernel_size`` ``in_channels`` and ``out_channels`` are supported. Kernel size candidates should be larger or smaller
  than each other in both candidates. See examples below:
  the following example is not allowed:
      >>> ValueChoice(candidates = [(5, 3), (3, 5)])
          □ ■ ■ ■ □   □ □ □ □ □
          □ ■ ■ ■ □   ■ ■ ■ ■ ■    # candidates are not bigger or smaller on both dimension
          □ ■ ■ ■ □   ■ ■ ■ ■ ■
          □ ■ ■ ■ □   ■ ■ ■ ■ ■
          □ ■ ■ ■ □   □ □ □ □ □
  the following 3 examples are valid:
      >>> ValueChoice(candidates = [5, 3, 1])
          ■ ■ ■ ■ ■   □ □ □ □ □   □ □ □ □ □
          ■ ■ ■ ■ ■   □ ■ ■ ■ □   □ □ □ □ □
          ■ ■ ■ ■ ■   □ ■ ■ ■ □   □ □ ■ □ □
          ■ ■ ■ ■ ■   □ ■ ■ ■ □   □ □ □ □ □
          ■ ■ ■ ■ ■   □ □ □ □ □   □ □ □ □ □
      >>> ValueChoice(candidates = [(5, 7), (3, 5), (1, 3)])
          ■ ■ ■ ■ ■ ■ ■  □ □ □ □ □ □ □   □ □ □ □ □ □ □
          ■ ■ ■ ■ ■ ■ ■  □ ■ ■ ■ ■ ■ □   □ □ □ □ □ □ □
          ■ ■ ■ ■ ■ ■ ■  □ ■ ■ ■ ■ ■ □   □ □ ■ ■ ■ □ □
          ■ ■ ■ ■ ■ ■ ■  □ ■ ■ ■ ■ ■ □   □ □ □ □ □ □ □
          ■ ■ ■ ■ ■ ■ ■  □ □ □ □ □ □ □   □ □ □ □ □ □ □
      >>> # when the difference between any two candidates is not even, the left upper will be picked:
      >>> ValueChoice(candidates = [(5, 5), (4, 4), (3, 3)])
          ■ ■ ■ ■ ■   ■ ■ ■ ■ □   □ □ □ □ □
          ■ ■ ■ ■ ■   ■ ■ ■ ■ □   □ ■ ■ ■ □
          ■ ■ ■ ■ ■   ■ ■ ■ ■ □   □ ■ ■ ■ □
          ■ ■ ■ ■ ■   ■ ■ ■ ■ □   □ ■ ■ ■ □
          ■ ■ ■ ■ ■   □ □ □ □ □   □ □ □ □ □
class_docstr_tok: ["Only","``","kernel_size","``","``","in_channels","``","and","``","out_channels","``","are","supported",".","Kernel","size","candidates","should","be","larger","or","smaller","than","each","other","in","both","candidates",".","See","examples","below",":","the","following","example","is","not","allowed",":",">",">",">","ValueChoice","(","candidates","=","[","(","5",",","3",")",",","(","3",",","5",")","]",")","\u25a1","\u25a0","\u25a0","\u25a0","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a0","\u25a0","\u25a0","\u25a1","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","#","candidates","are","not","bigger","or","smaller","on","both","dimension","\u25a1","\u25a0","\u25a0","\u25a0","\u25a1","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a1","\u25a0","\u25a0","\u25a0","\u25a1","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a1","\u25a0","\u25a0","\u25a0","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","the","following","3","examples","are","valid",":",">",">",">","ValueChoice","(","candidates","=","[","5",",","3",",","1","]",")","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a1","\u25a0","\u25a0","\u25a0","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a1","\u25a0","\u25a0","\u25a0","\u25a1","\u25a1","\u25a1","\u25a0","\u25a1","\u25a1","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a1","\u25a0","\u25a0","\u25a0","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1",">",">",">","ValueChoice","(","candidates","=","[","(","5",",","7",")",",","(","3",",","5",")",",","(","1",",","3",")","]",")","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a1","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a1","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a1","\u25a1","\u25a1","\u25a0","\u25a0","\u25a0","\u25a1","\u25a1","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a1","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1",">",">",">","#","when","the","difference","between","any","two","candidates","is","not","even",",","the","left","upper","will","be","picked",":",">",">",">","ValueChoice","(","candidates","=","[","(","5",",","5",")",",","(","4",",","4",")",",","(","3",",","3",")","]",")","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a1","\u25a1","\u25a0","\u25a0","\u25a0","\u25a1","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a1","\u25a1","\u25a0","\u25a0","\u25a0","\u25a1","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a1","\u25a1","\u25a0","\u25a0","\u25a0","\u25a1","\u25a0","\u25a0","\u25a0","\u25a0","\u25a0","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1","\u25a1"]
code: def __init__(self, module, name):
      self.label = name
      args = module.trace_kwargs
  
      # compulsory params
      if isinstance(args["in_channels"], ValueChoice):
          args["in_channels"] = max(args["in_channels"].candidates)
  
      self.out_channel_candidates = None
      if isinstance(args["out_channels"], ValueChoice):
          self.out_channel_candidates = sorted(
              args["out_channels"].candidates, reverse=True
          )
          args["out_channels"] = self.out_channel_candidates[0]
  
      # kernel_size may be an int or tuple, we turn it into a tuple for simplicity
      self.kernel_size_candidates = None
      if isinstance(args["kernel_size"], ValueChoice):
          # unify kernel size as tuple
          candidates = args["kernel_size"].candidates
          if not isinstance(candidates[0], tuple):
              candidates = [(k, k) for k in candidates]
  
          # sort kernel size in descending order
          self.kernel_size_candidates = sorted(
              candidates, key=lambda t: t[0], reverse=True
          )
          for i in range(0, len(self.kernel_size_candidates) - 1):
              bigger = self.kernel_size_candidates[i]
              smaller = self.kernel_size_candidates[i + 1]
              assert bigger[1] > smaller[1] or (
                  bigger[1] == smaller[1] and bigger[0] > smaller[0]
              ), (
                  f"Kernel_size candidates "
                  f"should be larger or smaller than each other on both dimensions, but found {bigger} and {smaller}."
              )
          args["kernel_size"] = self.kernel_size_candidates[0]
  
      super().__init__(**args)
      self.generate_architecture_params()
  
file_path: nni/nni/nas/oneshot/pytorch/supermodule/_singlepathnas.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from nni.nas.nn.pytorch import ValueChoice
label_desc: Use image node_id 1 to create a new DifferentiableSuperConv2d object from inherited base classes: nn with example: obj = DifferentiableSuperConv2d(module, name)