code: def test_sequence_recall_accumulates_and_resets_correctly(
      self, device: str
  ):
      recall = UnigramRecall()
      gold = torch.tensor([[1, 2, 3]], device=device)
      recall(torch.tensor([[[1, 2, 3]]], device=device), gold)
      recall(torch.tensor([[[7, 8, 4]]], device=device), gold)
  
      actual_recall = recall.get_metric(reset=True)["unigram_recall"]
      assert_allclose(actual_recall, 1 / 2)
      assert recall.correct_count == 0
      assert recall.total_count == 0
  
file_path: allennlp/tests/training/metrics/unigram_recall_test.py
imports: from typing import Any, Dict, List, Tuple, Union
  import torch
  from torch.testing import assert_allclose
  from allennlp.common.testing import AllenNlpTestCase, multi_device, global_distributed_metric, run_distributed_test
  from allennlp.training.metrics import UnigramRecall
label_desc: Use image node_id 3 for calling the UnigramRecallTest obj's underlying member method code with example usage: obj.test_sequence_recall_accumulates_and_resets_correctly(device) without return types