code: def test_chosen_inputs(
      space_format: Type[ExecutableModelSpace], nn: ModuleType
  ):
      class Net(ModelSpace, label_prefix="model"):
          def __init__(self, reduction):
              super().__init__()
              self.conv1 = nn.Conv2d(3, 3, kernel_size=1)
              self.conv2 = nn.Conv2d(3, 3, kernel_size=1)
              self.input = InputChoice(
                  2, n_chosen=2, reduction=reduction
              )
  
          def forward(self, x):
              x1 = self.conv1(x)
              x2 = self.conv2(x)
              return self.input([x1, x2])
  
      for reduction in ["none", "sum", "mean", "concat"]:
          model = space_format.from_model(Net(reduction))
          selected_model = model.random().executable_model()
          result = selected_model(torch.randn(1, 3, 3, 3))
          if reduction == "none":
              assert len(result) == 2
              assert result[0].size() == torch.Size([1, 3, 3, 3])
              assert result[1].size() == torch.Size([1, 3, 3, 3])
          elif reduction == "concat":
              assert result.size() == torch.Size([1, 6, 3, 3])
          else:
              assert result.size() == torch.Size([1, 3, 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 9 for calling a global function with example usage: test_chosen_inputs(space_format, nn) and returns: self