code: def test_fbeta_multiclass_macro_average_metric(self, device: str):
      self.predictions = self.predictions.to(device)
      self.targets = self.targets.to(device)
  
      fbeta = FBetaMeasure(average="macro")
      fbeta(self.predictions, self.targets)
      metric = fbeta.get_metric()
      precisions = metric["precision"]
      recalls = metric["recall"]
      fscores = metric["fscore"]
  
      # We keep the expected values in CPU because FBetaMeasure returns them in CPU.
      macro_precision = torch.tensor(self.desired_precisions).mean()
      macro_recall = torch.tensor(self.desired_recalls).mean()
      macro_fscore = torch.tensor(self.desired_fscores).mean()
      # check value
      assert_allclose(precisions, macro_precision)
      assert_allclose(recalls, macro_recall)
      assert_allclose(fscores, macro_fscore)
  
      # check type
      assert isinstance(precisions, float)
      assert isinstance(recalls, float)
      assert isinstance(fscores, float)
  
imports: from typing import Any, Dict, List, Tuple, Union
  import torch
  from sklearn.metrics import precision_recall_fscore_support
  from torch.testing import assert_allclose
  import pytest
  from allennlp.common.checks import ConfigurationError
  from allennlp.common.testing import AllenNlpTestCase, multi_device, run_distributed_test, global_distributed_metric
  from allennlp.training.metrics import FBetaMeasure
label_desc: Use image node_id 7 for calling the FBetaMeasureTest obj's underlying member method code with example usage: obj.test_fbeta_multiclass_macro_average_metric(device) without return types