code: def test_is_leaf_module():
      assert is_leaf_module(nn.Linear(2, 3))
      assert not is_leaf_module(nn.Sequential(nn.Linear(2, 3)))
      assert is_leaf_module(nas_nn.MutableLinear(2, 3))
  
      class MyLinear(nn.Linear):
          def __init__(self, in_features, out_features):
              super().__init__(in_features, out_features)
              self.register_buffer("buf", torch.randn(2, 3))
  
      assert not is_leaf_module(MyLinear(2, 3))
  
file_path: nni/test/ut/nas/profiler/test_utils.py
imports: import torch
  from torch import nn
  import nni
  import nni.nas.nn.pytorch
  from nni.mutable import Categorical, frozen_context
  from nni.mutable.mutable import _mutable_equal
  from nni.nas.profiler.pytorch.utils import _attrs, is_leaf_module, _expression
label_desc: Use image node_id 1 for calling a global function with example usage: test_is_leaf_module() without return types