code: def test_conv2d():
      # test conv 2d
      data = torch.rand(2, 3, 4, 4)
      conv2d = torch.nn.Conv2d(
          in_channels=3, out_channels=4, kernel_size=2
      )
      materialized_output = conv2d(data)
      _assert_output_shape(
          data=data,
          module=conv2d,
          patch_fn=patched_module.torch_nn_conv2d,
          expect_exception=False,
          output_shape=materialized_output.shape,
      )
  
      conv2d = torch.nn.Conv2d(
          in_channels=3, out_channels=4, kernel_size=2, padding=1
      )
      materialized_output = conv2d(data)
      _assert_output_shape(
          data=data,
          module=conv2d,
          patch_fn=patched_module.torch_nn_conv2d,
          expect_exception=False,
          output_shape=materialized_output.shape,
      )
  
      conv2d = torch.nn.Conv2d(
          in_channels=3,
          out_channels=4,
          kernel_size=2,
          padding=1,
          dilation=2,
      )
      materialized_output = conv2d(data)
      _assert_output_shape(
          data=data,
          module=conv2d,
          patch_fn=patched_module.torch_nn_conv2d,
          expect_exception=False,
          output_shape=materialized_output.shape,
      )
  
      conv2d = torch.nn.Conv2d(
          in_channels=3,
          out_channels=4,
          kernel_size=2,
          padding=1,
          dilation=2,
          padding_mode="reflect",
      )
      materialized_output = conv2d(data)
      _assert_output_shape(
          data=data,
          module=conv2d,
          patch_fn=patched_module.torch_nn_conv2d,
          expect_exception=False,
          output_shape=materialized_output.shape,
      )
  
imports: import torch
  from colossalai.fx.tracer.meta_patch import patched_module
  from colossalai.testing import clear_cache_before_run
label_desc: Use image node_id 7 for calling a global function with example usage: test_conv2d() without return types