class_docstr: Test various Torch Generator agent behaviors.
class_docstr_tok: ["Test","various","Torch","Generator","agent","behaviors","."]
docstr: Test --beam-block-full-context with older model files.
docstr_tok: ["Test","--","beam-block-full-context","with","older","model","files","."]
code: def test_block_full_context(self):
      """
      Test --beam-block-full-context with older model files.
      """
      # old model file == beam block full context false
      pp = ParlaiParser(True, True)
      opt = pp.parse_args(
          ["--model-file", "zoo:unittest/transformer_generator2/model"]
      )
      agent = create_agent(opt, True)
      self.assertEqual(agent.opt["beam_block_full_context"], False)
      self.assertEqual(agent.beam_block_full_context, False)
  
      # brand new model == beam block full context true
      pp = ParlaiParser(True, True)
      opt = pp.parse_args(["--model", "transformer/generator"])
      agent = create_agent(opt, True)
      self.assertEqual(agent.opt["beam_block_full_context"], True)
      self.assertEqual(agent.beam_block_full_context, True)
  
imports: import unittest
  import math
  import torch
  from parlai.core.agents import create_agent
  from parlai.core.dict import DictionaryAgent
  import parlai.utils.testing
  from parlai.core.params import ParlaiParser
  from parlai.core.torch_generator_agent import BeamSearch, GreedySearch, NucleusSampling, FactualNucleusSampling, TopKSampling, TorchGeneratorAgent
  from parlai.agents.test_agents.transformer_generator_prefix import PREFIX_TEXT
label_desc: Use image node_id 4 for calling the TestTGA obj's underlying member method code with example usage: obj.test_block_full_context() without return types