code: def test_repeat_nested(predictor):
      net = Repeat(
          lambda d: LayerChoice(
              [
                  nn.Sequential(
                      nn.Conv2d(32, 128, 1), nn.Conv2d(128, 32, 1)
                  ),
                  nn.Sequential(
                      nn.Conv2d(32, 1, 1), nn.Conv2d(1, 32, 1)
                  ),
              ],
              label=f"d{d}",
          ),
          (1, 3),
          label="rep",
      )
  
      profiler = NnMeterProfiler(
          net, torch.randn(1, 32, 32, 32), predictor
      )
      assert profiler.profile(
          {"rep": 1, "d0": 0, "d1": 0, "d2": 0}
      ) < profiler.profile({"rep": 3, "d0": 0, "d1": 0, "d2": 0})
      assert profiler.profile(
          {"rep": 3, "d0": 0, "d1": 1, "d2": 0}
      ) < profiler.profile({"rep": 3, "d0": 0, "d1": 0, "d2": 0})
  
      result = profiler.profile({"rep": 2, "d0": 0, "d1": 1, "d2": 0})
  
      class CustomProfiler(NnMeterProfiler):
          def estimate_repeat_latency(self, *args):
              raise RuntimeError()
  
          def estimate_layerchoice_latency(self, *args):
              raise RuntimeError()
  
          def is_leaf_module(self, module: nn.Module) -> bool:
              return super().is_leaf_module(module) or isinstance(
                  module, Repeat
              )
  
      profiler = CustomProfiler(
          net, torch.randn(1, 32, 32, 32), predictor
      )
      # NOTE: I'm not sure. Not true if conv-conv fusion?
      assert (
          result * 0.95
          < profiler.profile({"rep": 2, "d0": 0, "d1": 1, "d2": 0})
          < result * 1.05
      )
  
imports: import pytest
  import torch
  from torch import nn
  import nni
  from nni.mutable import Categorical
  from nni.nas.hub.pytorch import *
  from nni.nas.hub.pytorch.mobilenetv3 import SqueezeExcite
  from nni.nas.hub.pytorch.proxylessnas import ConvBNReLU, DepthwiseSeparableConv, InvertedResidual
  from nni.nas.nn.pytorch import MutableConv2d, MutableLinear, LayerChoice, Repeat
  from nni.nas.profiler.pytorch.nn_meter import NnMeterProfiler, to_onnx, combinations
  from nni.nas.profiler.pytorch.utils import MutableShape
  from nn_meter import load_latency_predictor
  from ut.nas.nn.models import MODELS
label_desc: Use image node_id 7 for calling a global function with example usage: test_repeat_nested(predictor) and returns: unknown