class_docstr: The full search space proposed by `NAS-Bench-101 <http://proceedings.mlr.press/v97/ying19a/ying19a.pdf>`__.
  
  It's simply a stack of :class:`~nni.nas.hub.pytorch.modules.NasBench101Cell`. Operations are conv3x3, conv1x1 and maxpool respectively.
  
  Parameters
  ----------
  stem_out_channels
      Number of output channels of the stem convolution.
  num_stacks
      Number of stacks in the network.
  num_modules_per_stack
      Number of modules in each stack. Each module is a :class:`~nni.nas.nn.pytorch.NasBench101Cell`.
  max_num_vertices
      Maximum number of vertices in each cell.
  max_num_edges
      Maximum number of edges in each cell.
  num_labels
      Number of categories for classification.
  bn_eps
      Epsilon for batch normalization.
  bn_momentum
      Momentum for batch normalization.
class_docstr_tok: ["The","full","search","space","proposed","by","`","NAS-Bench-101","<","http",":","\/\/proceedings.mlr.press\/v97\/ying19a\/ying19a.pdf",">","`","__",".","It","'s","simply","a","stack","of",":","class",":","`","~nni.nas.hub.pytorch.modules.NasBench101Cell","`",".","Operations","are","conv3x3",",","conv1x1","and","maxpool","respectively",".","Parameters","--","--","--","--","--","stem_out_channels","Number","of","output","channels","of","the","stem","convolution",".","num_stacks","Number","of","stacks","in","the","network",".","num_modules_per_stack","Number","of","modules","in","each","stack",".","Each","module","is","a",":","class",":","`","~nni.nas.nn.pytorch.NasBench101Cell","`",".","max_num_vertices","Maximum","number","of","vertices","in","each","cell",".","max_num_edges","Maximum","number","of","edges","in","each","cell",".","num_labels","Number","of","categories","for","classification",".","bn_eps","Epsilon","for","batch","normalization",".","bn_momentum","Momentum","for","batch","normalization","."]
code: def __init__(
      self,
      stem_out_channels: int = 128,
      num_stacks: int = 3,
      num_modules_per_stack: int = 3,
      max_num_vertices: int = 7,
      max_num_edges: int = 9,
      num_labels: int = 10,
      bn_eps: float = 1e-5,
      bn_momentum: float = 0.003,
  ):
      super().__init__()
  
      op_candidates = {
          "conv3x3-bn-relu": lambda num_features: Conv3x3BNReLU(
              num_features, num_features
          ),
          "conv1x1-bn-relu": lambda num_features: Conv1x1BNReLU(
              num_features, num_features
          ),
          "maxpool3x3": lambda num_features: nn.MaxPool2d(3, 1, 1),
      }
  
      # initial stem convolution
      self.stem_conv = Conv3x3BNReLU(3, stem_out_channels)
  
      layers = []
      in_channels = out_channels = stem_out_channels
      for stack_num in range(num_stacks):
          if stack_num > 0:
              downsample = nn.MaxPool2d(kernel_size=2, stride=2)
              layers.append(downsample)
              out_channels *= 2
          for _ in range(num_modules_per_stack):
              cell = NasBench101Cell(
                  op_candidates,
                  in_channels,
                  out_channels,
                  lambda cin, cout: Projection(cin, cout),
                  max_num_vertices,
                  max_num_edges,
                  label="cell",
              )
              layers.append(cell)
              in_channels = out_channels
  
      self.features = nn.ModuleList(layers)
      self.gap = nn.AdaptiveAvgPool2d(1)
      self.classifier = nn.Linear(out_channels, num_labels)
  
      for module in self.modules():
          if isinstance(module, nn.BatchNorm2d):
              module.eps = bn_eps
              module.momentum = bn_momentum
  
imports: import math
  import torch
  import torch.nn
  from nni.nas.nn.pytorch import ModelSpace
  from .modules.nasbench101 import NasBench101Cell
label_desc: Use image node_id 1 to create a new NasBench101 object from inherited base classes: ModelSpace with example: obj = NasBench101(stem_out_channels, num_stacks, num_modules_per_stack, max_num_vertices, max_num_edges, num_labels, bn_eps, bn_momentum)