code: def test_attachment_scores_can_ignore_labels(self, device: str):
      self._send_tensors_to_device(device)
  
      scorer = AttachmentScores(ignore_classes=[1])
  
      label_predictions = self.label_predictions
      # Change the predictions where the gold label is 1;
      # as we are ignoring 1, we should still get a perfect score.
      label_predictions[0, 3] = 2
      scorer(
          self.predictions,
          label_predictions,
          self.gold_indices,
          self.gold_labels,
          self.mask,
      )
  
      for value in scorer.get_metric().values():
          assert value == 1.0
  
file_path: allennlp/tests/training/metrics/attachment_scores_test.py
imports: from typing import Any, Dict, List, Tuple, Union
  import torch
  from allennlp.common.testing import AllenNlpTestCase, multi_device, run_distributed_test, global_distributed_metric
  from allennlp.training.metrics import AttachmentScores
label_desc: Use image node_id 6 for calling the AttachmentScoresTest obj's underlying member method code with example usage: obj.test_attachment_scores_can_ignore_labels(device) without return types