code: def test_fbeta_multilabel_with_macro_average(self, device: str):
      self.predictions = self.predictions.to(device)
      self.targets = self.targets.to(device)
  
      labels = [0, 1]
      fbeta = FBetaMultiLabelMeasure(average="macro", labels=labels)
      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)[
          labels
      ].mean()
      macro_recall = torch.tensor(self.desired_recalls)[labels].mean()
      macro_fscore = torch.tensor(self.desired_fscores)[labels].mean()
  
      # check value
      assert_allclose(precisions, macro_precision)
      assert_allclose(recalls, macro_recall)
      assert_allclose(fscores, macro_fscore)
  
imports: from typing import Dict, List, Tuple, Union, Any
  import pytest
  import torch
  from allennlp.common.checks import ConfigurationError
  from allennlp.common.testing import AllenNlpTestCase, global_distributed_metric, multi_device, run_distributed_test
  from sklearn.metrics import precision_recall_fscore_support
  from torch.testing import assert_allclose
  from allennlp.training.metrics import FBetaMultiLabelMeasure
label_desc: Use image node_id 11 for calling the FBetaMultiLabelMeasureTest obj's underlying member method code with example usage: obj.test_fbeta_multilabel_with_macro_average(device) without return types