code: def test_proxylessnas():
      net = ProxylessNAS()
  
      proxy_mobile_arch = {
          "s2_depth": 2,
          "s2_i0": "k5e3",
          "s2_i1": "k3e3",
          "s3_depth": 4,
          "s3_i0": "k7e3",
          "s3_i1": "k3e3",
          "s3_i2": "k5e3",
          "s3_i3": "k5e3",
          "s4_depth": 4,
          "s4_i0": "k7e6",
          "s4_i1": "k5e3",
          "s4_i2": "k5e3",
          "s4_i3": "k5e3",
          "s5_depth": 4,
          "s5_i0": "k5e6",
          "s5_i1": "k5e3",
          "s5_i2": "k5e3",
          "s5_i3": "k5e3",
          "s6_depth": 4,
          "s6_i0": "k7e6",
          "s6_i1": "k7e6",
          "s6_i2": "k7e3",
          "s6_i3": "k7e3",
          "s7_depth": 1,
          "s7_i0": "k7e6",
      }
      model = net.freeze(proxy_mobile_arch)
      from nni.compression.utils.counter import count_flops_params
  
      flops, params, _ = count_flops_params(
          model, torch.randn(1, 3, 224, 224)
      )
  
      # Hack because expression switch doesn't support lazy evaluation.
      sample = {}
      net.default(sample)
      sample.update(proxy_mobile_arch)
  
      profiler = FlopsParamsProfiler(
          net,
          torch.randn(1, 3, 224, 224),
          count_bias=False,
          count_normalization=False,
          count_activation=False,
      )
      result = profiler.profile(sample)
      assert result.flops == flops
      assert result.params == params
  
file_path: nni/test/algo/nas/profiler/test_flops.py
imports: import torch
  from nni.compression.utils.counter import count_flops_params
  from nni.nas.hub.pytorch import ProxylessNAS, MobileNetV3Space, AutoFormer, ShuffleNetSpace
  from nni.nas.profiler.pytorch.flops import FlopsParamsProfiler
label_desc: Use image node_id 1 for calling a global function with example usage: test_proxylessnas() without return types