class_docstr: The fixed version of NAS-Bench-101 Cell, used in python-version execution engine.
class_docstr_tok: ["The","fixed","version","of","NAS-Bench-101","Cell",",","used","in","python-version","execution","engine","."]
code: def __init__(
      self,
      operations: List[Callable[[int], nn.Module]],
      adjacency_list: List[List[int]],
      in_features: int,
      out_features: int,
      num_nodes: int,
      projection: Callable[[int, int], nn.Module],
  ):
      super().__init__()
  
      assert num_nodes == len(operations) + 2 == len(adjacency_list) + 1
  
      raw_operations: List[
          Union[str, Callable[[int], nn.Module]]
      ] = list(operations)
      del operations  # operations is no longer needed. Delete it to avoid misuse
  
      # add psuedo nodes
      raw_operations.insert(0, "IN")
      raw_operations.append("OUT")
  
      self.connection_matrix = self.build_connection_matrix(
          adjacency_list, num_nodes
      )
      del num_nodes  # raw number of nodes is no longer used
  
      self.connection_matrix, self.operations = prune(
          self.connection_matrix, raw_operations
      )
  
      self.hidden_features = compute_vertex_channels(
          in_features, out_features, self.connection_matrix
      )
  
      self.num_nodes = len(self.connection_matrix)
      self.in_features = in_features
      self.out_features = out_features
      _logger.info("Prund number of nodes: %d", self.num_nodes)
      _logger.info(
          "Pruned connection matrix: %s", str(self.connection_matrix)
      )
  
      self.projections = nn.ModuleList([nn.Identity()])
      self.ops = nn.ModuleList([nn.Identity()])
      for i in range(1, self.num_nodes):
          self.projections.append(
              projection(in_features, self.hidden_features[i])
          )
  
      for i in range(1, self.num_nodes - 1):
          operation = cast(
              Callable[[int], nn.Module], self.operations[i]
          )
          self.ops.append(operation(self.hidden_features[i]))
  
imports: import logging
  from collections import OrderedDict
  from typing import Callable, List, Optional, Union, Dict, Tuple, Callable, Iterable, Any, cast
  import numpy
  import torch
  import torch.nn
  from nni.mutable import Constraint, Categorical, CategoricalMultiple, Constraint, ConstraintViolation, Mutable, LabeledMutable, Sample, SampleValidationError, auto_label, label_scope
  from nni.mutable.mutable import _mutable_equal
  from nni.nas.nn.pytorch import InputChoice, LayerChoice, MutableModule
label_desc: Use image node_id 1 to create a new _NasBench101CellFixed object from inherited base classes: nn with example: obj = _NasBench101CellFixed(operations, adjacency_list, in_features, out_features, num_nodes, projection)