code: def test_input_choice(
      space_format: Type[ExecutableModelSpace], nn: ModuleType
  ):
      class Net(ModelSpace, label_prefix="model"):
          def __init__(self):
              super().__init__()
              self.conv1 = nn.Conv2d(3, 3, kernel_size=1)
              self.conv2 = nn.Conv2d(3, 5, kernel_size=1)
              self.input = InputChoice(2)
  
          def forward(self, x):
              x1 = self.conv1(x)
              x2 = self.conv2(x)
              return self.input([x1, x2])
  
      model = Net()
      assert model.input.label == "model/1"
      model = space_format.from_model(model)
      assert len(model.simplify()) == 1
      label = next(iter(model.simplify().keys()))
  
      if issubclass(space_format, GraphModelSpace):
          # Graph space doesn't support list
          model1 = model.freeze({label: 0}).executable_model()
          model2 = model.freeze({label: 1}).executable_model()
      else:
          model1 = model.freeze({label: [0]}).executable_model()
          model2 = model.freeze({label: [1]}).executable_model()
  
      assert model1(torch.randn(1, 3, 3, 3)).size() == torch.Size(
          [1, 3, 3, 3]
      )
      assert model2(torch.randn(1, 3, 3, 3)).size() == torch.Size(
          [1, 5, 3, 3]
      )
  
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 8 for calling a global function with example usage: test_input_choice(space_format, nn) and returns: self