code: def test_three_classes_normalized(self, device, dtype):
      num_classes = 3
      normalized = True
      actual = torch.tensor(
          [[2, 2, 0, 0, 1, 0, 0, 2, 1, 1, 0, 0, 1, 2, 1, 0]],
          device=device,
          dtype=torch.long,
      )
      predicted = torch.tensor(
          [[2, 1, 0, 0, 0, 0, 0, 1, 0, 2, 2, 1, 0, 0, 2, 2]],
          device=device,
          dtype=torch.long,
      )
  
      conf_mat = kornia.metrics.confusion_matrix(
          predicted, actual, num_classes, normalized
      )
  
      conf_mat_real = torch.tensor(
          [
              [
                  [0.5000, 0.3333, 0.4000],
                  [0.3750, 0.0000, 0.4000],
                  [0.1250, 0.6667, 0.2000],
              ]
          ],
          device=device,
          dtype=torch.float32,
      )
  
      assert_close(conf_mat, conf_mat_real)
  
imports: import pytest
  import torch
  import kornia
  from kornia.testing import BaseTester, assert_close, tensor_to_gradcheck_var
label_desc: Use image node_id 5 for calling the TestConfusionMatrix obj's underlying member method code with example usage: obj.test_three_classes_normalized(device, dtype) without return types