code: def test_value_choice_in_layer_choice(
      space_format: Type[ExecutableModelSpace], nn: ModuleType
  ):
      class Net(ModelSpace, label_prefix="model"):
          def __init__(self):
              super().__init__()
              self.linear = LayerChoice(
                  [
                      MutableLinear(3, Categorical([10, 20])),
                      MutableLinear(3, Categorical([30, 40])),
                  ]
              )
  
          def forward(self, x):
              return self.linear(x)
  
      model = space_format.from_model(Net())
      assert len(model.simplify()) == 3
      sizes = []
      for selected_model in model.grid():
          sizes.append(
              selected_model.executable_model()(torch.randn(1, 3)).size(
                  1
              )
          )
      assert len(sizes) == 8  # 2 * 2 * 2
      assert set(sizes) == set([10, 20, 30, 40])
  
imports: import copy
  import random
  from types import ModuleType
  from typing import Type
  import pytest
  import nni
  import nni.nas.nn.pytorch.layers
  import nni.nas.evaluator.pytorch.lightning
  import torch
  import torch.nn.functional
  from nni.mutable import Categorical, ensure_frozen, label_scope, SampleValidationError
  from nni.nas.evaluator import FunctionalEvaluator
  from nni.nas.space import RawFormatModelSpace, SimplifiedModelSpace, ExecutableModelSpace, GraphModelSpace, model_context
  from nni.nas.space.pytorch import PytorchGraphModelSpace
  from nni.nas.nn.pytorch import ParametrizedModule, MutableModule, ModelSpace, LayerChoice, InputChoice, Cell, ChosenInputs, MutableConv2d, MutableLinear
label_desc: Use image node_id 16 for calling a global function with example usage: test_value_choice_in_layer_choice(space_format, nn) and returns: self