code: def test_conv():
      net = nn.Sequential(nn.Conv2d(3, 2, 3, bias=True))
      profiler = FlopsParamsProfiler(net, torch.randn(3, 224, 224))
      assert profiler.profile({}).flops == 2759904
  
      net = nas_nn.MutableConv2d(
          1, 1, Categorical([3, 5], label="a"), bias=False
      )
      profiler = FlopsParamsProfiler(net, torch.randn(1, 1, 5, 5))
      assert profiler.profile({"a": 3}).flops == 81
      assert profiler.profile({"a": 5}).flops == 25
      assert profiler.profile({"a": 3}).params == 9
  
      net = nas_nn.MutableConv2d(
          1, 1, Categorical([3, 5], label="a"), bias=True
      )
      profiler = FlopsParamsProfiler(
          net, torch.randn(1, 1, 5, 5), count_bias=False
      )
      assert profiler.profile({"a": 3}).flops == 81
      assert profiler.profile({"a": 5}).flops == 25
      assert profiler.profile({"a": 3}).params == 10
  
file_path: nni/test/ut/nas/profiler/test_flops.py
imports: import pytest
  import torch
  from torch import nn
  import nni
  import nni.nas.nn.pytorch
  from nni.mutable import Categorical
  from nni.nas.profiler.pytorch.flops import FlopsParamsProfiler, FlopsProfiler, NumParamsProfiler, FlopsResult, register_flops_formula
  from ut.nas.nn.models import MODELS
label_desc: Use image node_id 1 for calling a global function with example usage: test_conv() without return types