code: def test_forward_against_huggingface_output(
      transformer_embeddings, module_name, hf_module
  ):
      input_ids = torch.tensor([[1, 2]])
      token_type_ids = torch.tensor([[1, 0]], dtype=torch.long)
      position_ids = torch.tensor([[0, 1]])
  
      state_dict = transformer_embeddings._get_mapped_state_dict(
          hf_module.state_dict()
      )
      if "position_ids" in state_dict:
          del state_dict["position_ids"]
      transformer_embeddings.load_state_dict(state_dict)
  
      torch.manual_seed(1234)
      transformer_embeddings = (
          transformer_embeddings.eval()
      )  # setting to eval mode to avoid non-deterministic dropout.
      output = transformer_embeddings(
          input_ids=input_ids,
          token_type_ids=token_type_ids,
          position_ids=position_ids,
      )
  
      torch.manual_seed(1234)
      hf_module = (
          hf_module.eval()
      )  # setting to eval mode to avoid non-deterministic dropout.
      hf_output = hf_module(
          input_ids=input_ids,
          token_type_ids=token_type_ids,
          position_ids=position_ids,
      )
  
      assert torch.allclose(output, hf_output)
  
imports: import copy
  import pytest
  import torch
  from torch.testing import assert_allclose
  from transformers import AutoModel
  from transformers.models.bert.configuration_bert import BertConfig
  from transformers.models.bert.modeling_bert import BertEmbeddings
  from transformers.models.albert.configuration_albert import AlbertConfig
  from transformers.models.albert.modeling_albert import AlbertEmbeddings
  from allennlp.common import Params, FromParams
  from allennlp.modules.transformer import TransformerEmbeddings, ImageFeatureEmbeddings, TransformerModule
label_desc: Use image node_id 12 for calling a global function with example usage: test_forward_against_huggingface_output(transformer_embeddings, module_name, hf_module) without return types