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 generate_architecture_params(self):
      self.alpha = {}
      if self.kernel_size_candidates is not None:
          # kernel size arch params
          self.t_kernel = nn.Parameter(
              torch.rand(len(self.kernel_size_candidates) - 1)
          )
          self.alpha["kernel_size"] = self.t_kernel
          # kernel size mask
          self.kernel_masks = []
          for i in range(0, len(self.kernel_size_candidates) - 1):
              big_size = self.kernel_size_candidates[i]
              small_size = self.kernel_size_candidates[i + 1]
              mask = torch.zeros_like(self.weight)
              mask[
                  :, :, : big_size[0], : big_size[1]
              ] = 1  # if self.weight.shape = (out, in, 7, 7), big_size = (5, 5) and
              mask[
                  :, :, : small_size[0], : small_size[1]
              ] = 0  # small_size = (3, 3), mask will look like:
              self.kernel_masks.append(mask)  # 0 0 0 0 0 0 0
          mask = torch.zeros_like(self.weight)  # 0 1 1 1 1 1 0
          mask[
              :,
              :,
              : self.kernel_size_candidates[-1][0],
              : self.kernel_size_candidates[-1][1],
          ] = 1  # 0 1 0 0 0 1 0
          self.kernel_masks.append(mask)  # 0 1 0 0 0 1 0
          #   0 1 0 0 0 1 0
      if self.out_channel_candidates is not None:  # 0 1 1 1 1 1 0
          # out_channel (or expansion) arch params. we do not consider skip-op here, so we            #   0 0 0 0 0 0 0
          # only generate ``len(self.kernel_size_candidates) - 1 `` thresholds
          self.t_expansion = nn.Parameter(
              torch.rand(len(self.out_channel_candidates) - 1)
          )
          self.alpha["out_channels"] = self.t_expansion
          self.channel_masks = []
          for i in range(0, len(self.out_channel_candidates) - 1):
              big_channel, small_channel = (
                  self.out_channel_candidates[i],
                  self.out_channel_candidates[i + 1],
              )
              mask = torch.zeros_like(self.weight)
              mask[:big_channel] = 1
              mask[:small_channel] = 0
              # if self.weight.shape = (32, in, W, H), big_channel = 16 and small_size = 8, mask will look like:
              # 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
              self.channel_masks.append(mask)
          mask = torch.zeros_like(self.weight)
          mask[: self.out_channel_candidates[-1]] = 1
          self.channel_masks.append(mask)
  
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 7 for calling the DifferentiableSuperConv2d obj's underlying member method code with example usage: obj.generate_architecture_params() without return types