code: def test_embeddings_stay_the_same_after_saving_and_loading(
      self, args
  ):
      embeddings = self.create_embedding_with_args(args)
  
      sentence_old: Sentence = Sentence("I love Berlin")
      embeddings.embed(sentence_old)
      names_old = embeddings.get_names()
      embedding_length_old = embeddings.embedding_length
  
      save_data = embeddings.save_embeddings(use_state_dict=True)
      del embeddings
      new_embeddings = load_embeddings(save_data)
  
      sentence_new: Sentence = Sentence("I love Berlin")
      new_embeddings.embed(sentence_new)
      names_new = new_embeddings.get_names()
      embedding_length_new = new_embeddings.embedding_length
  
      assert names_old == names_new
      assert embedding_length_old == embedding_length_new
  
      if self.is_token_embedding:
          for token_old, token_new in zip(sentence_old, sentence_new):
              assert (
                  token_old.get_embedding(names_old)
                  == token_new.get_embedding(names_new)
              ).all()
      if self.is_document_embedding:
          assert (
              sentence_old.get_embedding(names_old)
              == sentence_new.get_embedding(names_new)
          ).all()
  
file_path: flair/tests/embedding_test_utils.py
imports: from typing import Any, Dict, List, Optional, Type
  import pytest
  import torch
  from flair.data import Sentence
  from flair.embeddings import Embeddings
  from flair.embeddings.base import load_embeddings
label_desc: Use image node_id 8 for calling the BaseEmbeddingsTest obj's underlying member method code with example usage: obj.test_embeddings_stay_the_same_after_saving_and_loading(args) without return types