class_docstr: Test of BART model.
docstr: Test BART text vec caching.
code: def test_bart_cache_text_vec(self):
      """
      Test BART text vec caching.
      """
      opt = ParlaiParser(True, True).parse_args(["--model", "bart"])
      bart = create_agent(opt)
  
      # obs 1
      text = "Don't have a cow, Man!"
      in_obs = {"text": text, "episode_done": True}
      out_obs = bart.observe(in_obs)
      cached_text_vec = out_obs["text_vec"]
      _ = bart.act()
  
      # obs 2
      in_obs = {"text_vec": cached_text_vec, "episode_done": True}
      out_obs = bart.observe(in_obs)
      cached_text_vec_2 = out_obs["text_vec"]
  
      self.assertEqual(
          cached_text_vec.tolist(), cached_text_vec_2.tolist()
      )
  
file_path: ParlAI/tests/nightly/gpu/test_bart.py
imports: import os
  import unittest
  from parlai.core.agents import create_agent
  from parlai.core.params import ParlaiParser
  import parlai.utils.testing
  from parlai.utils.testing import tempdir
label_desc: Use image node_id 3 for calling the TestBartModel obj's underlying member method code with example usage: obj.test_bart_cache_text_vec() without return types