class_docstr: The implementation of super-net cell follows `DARTS <https://github.com/quark0/darts>`__.
  
  When ``factory_used`` is true, it reconstructs the cell for every possible combination of operation and input index,
  because for different input index, the cell factory could instantiate different operations (e.g., with different stride).
  On export, we first have best (operation, input) pairs, the select the best ``num_ops_per_node``.
  
  ``loose_end`` is not supported yet, because it will cause more problems (e.g., shape mismatch).
  We assumes ``loose_end`` to be ``all`` regardless of its configuration.
  
  A supernet cell can't slim its own weight to fit into a sub network, which is also a known issue.
class_docstr_tok: ["The","implementation","of","super-net","cell","follows","`","DARTS","<","https",":","\/\/github.com\/quark0\/darts",">","`","__",".","When","``","factory_used","``","is","true",",","it","reconstructs","the","cell","for","every","possible","combination","of","operation","and","input","index",",","because","for","different","input","index",",","the","cell","factory","could","instantiate","different","operations","(","e.g.",",","with","different","stride",")",".","On","export",",","we","first","have","best","(","operation",",","input",")","pairs",",","the","select","the","best","``","num_ops_per_node","``",".","``","loose_end","``","is","not","supported","yet",",","because","it","will","cause","more","problems","(","e.g.",",","shape","mismatch",")",".","We","assumes","``","loose_end","``","to","be","``","all","``","regardless","of","its","configuration",".","A","supernet","cell","ca","n't","slim","its","own","weight","to","fit","into","a","sub","network",",","which","is","also","a","known","issue","."]
code: def forward(
      self, *inputs: list[torch.Tensor] | torch.Tensor
  ) -> tuple[torch.Tensor, ...] | torch.Tensor:
      processed_inputs: List[torch.Tensor] = preprocess_cell_inputs(
          self.num_predecessors, *inputs
      )
      states: List[torch.Tensor] = self.preprocessor(processed_inputs)
      for i, ops in enumerate(
          cast(Sequence[Sequence[Dict[str, nn.Module]]], self.ops),
          start=self.num_predecessors,
      ):
          current_state = []
  
          for k in range(self.num_ops_per_node):
              # Select op list based on the input chosen
              input_index = self._sampled[
                  f"{self.label}/input_{i}_{k}"
              ][
                  0
              ]  # [0] because it's a list and n_chosen=1
              op_candidates = ops[cast(int, input_index)]
              # Select op from op list based on the op chosen
              op_index = self._sampled[f"{self.label}/op_{i}_{k}"]
              op = op_candidates[cast(str, op_index)]
              current_state.append(op(states[cast(int, input_index)]))
  
          states.append(sum(current_state))  # type: ignore
  
      # Always merge all
      this_cell = torch.cat(
          states[self.num_predecessors :], self.concat_dim
      )
      return self.postprocessor(this_cell, processed_inputs)
  
imports: from __future__ import annotations
  import copy
  import functools
  import random
  from typing import Any, List, Dict, Sequence, cast
  import torch
  import torch.nn
  from nni.mutable import MutableExpression, label_scope, Mutable, Categorical, CategoricalMultiple
  from nni.nas.nn.pytorch import LayerChoice, InputChoice, Repeat, Cell
  from nni.nas.nn.pytorch.cell import CellOpFactory, create_cell_op_candidates, preprocess_cell_inputs
  from .base import BaseSuperNetModule
  from ._expression_utils import weighted_sum
  from .operation import MixedOperationSamplingPolicy, MixedOperation
label_desc: Use image node_id 6 for calling the PathSamplingCell obj's underlying member method code with example usage: obj.forward() and returns: self