code: def test_cosine_embedding_loss(self):
      cos_emb_loss = losses.CosineEmbeddingLoss()
  
      # Test random tensor but the same targets and scores
      torch.manual_seed(1234)
      random_tensor = torch.rand((1, 768))
      sample_list = {"targets": random_tensor}
      model_output = {"scores": random_tensor}
      self.assertEqual(
          cos_emb_loss(sample_list, model_output).item(), 0.0
      )
  
imports: import collections
  import unittest
  from unittest.mock import MagicMock
  import mmf.modules.losses
  import torch
  import torch.nn
  import torch.nn.functional
  from mmf.common.registry import registry
  from mmf.common.sample import SampleList
label_desc: Use image node_id 8 for calling the TestModuleLosses obj's underlying member method code with example usage: obj.test_cosine_embedding_loss() without return types