code: def test_num_levels(
      self, batch_size, channels, max_level, device, dtype
  ):
      height, width = 16, 20
      sample = torch.rand(
          batch_size,
          channels,
          height,
          width,
          device=device,
          dtype=dtype,
      )
      pyramid = kornia.geometry.transform.build_pyramid(
          sample, max_level
      )
      assert len(pyramid) == max_level
      for i in range(1, max_level):
          img = pyramid[i]
          denom = 2**i
          expected_shape = (
              batch_size,
              channels,
              height // denom,
              width // denom,
          )
          assert img.shape == expected_shape
  
imports: import pytest
  import torch
  from torch.autograd import gradcheck
  import kornia
  import kornia.testing
  from kornia.testing import BaseTester, assert_close
label_desc: Use image node_id 2 for calling the TestBuildPyramid obj's underlying member method code with example usage: obj.test_num_levels(batch_size, channels, max_level, device, dtype) without return types