code: def test_mutual_info_score_functional_single_cluster():
      """Check that for single cluster the metric returns 0."""
      tensor_a = torch.randint(NUM_CLASSES, (BATCH_SIZE,))
      tensor_b = torch.zeros(BATCH_SIZE, dtype=torch.int)
      assert torch.allclose(
          mutual_info_score(tensor_a, tensor_b), torch.tensor(0.0)
      )
      assert torch.allclose(
          mutual_info_score(tensor_b, tensor_a), torch.tensor(0.0)
      )
  
file_path: torchmetrics/tests/unittests/clustering/test_mutual_info_score.py
imports: import pytest
  import torch
  from sklearn.metrics import mutual_info_score
  from torchmetrics.clustering.mutual_info_score import MutualInfoScore
  from torchmetrics.functional.clustering.mutual_info_score import mutual_info_score
  from unittests import BATCH_SIZE, NUM_CLASSES
  from unittests.clustering.inputs import _float_inputs_extrinsic, _single_target_extrinsic1, _single_target_extrinsic2
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester
label_desc: Use image node_id 1 for calling a global function with example usage: test_mutual_info_score_functional_single_cluster() without return types