class_docstr: Test of DialoGPT model.
code: def _test_batchsize(self, batchsize, add_start_token):
      utterances = [
          "How is your day so far?",
          "I hope you you have a good day.",
          "Nice to meet you. My name is John. ",
          "I've got a feeling we're not in Kansas anymore.",
      ]
      opt = {
          "model": "hugging_face/dialogpt",
          "gpt2_size": "small",
          "text_truncate": 100,
          "label_truncate": 20,
          "beam_min_length": 1,
          "inference": "beam",
          "beam_size": 1,
          "add_special_tokens": True,
          "batchsize": batchsize,
          "add_start_token": add_start_token,
      }
      dialogpt = create_agent(opt)
  
      results_single = []
      agents = [dialogpt.clone() for _ in utterances]
      for u, a in zip(utterances, agents):
          a.observe({"text": u, "episode_done": True})
          generation = a.act()["text"]
          results_single.append(generation)
  
      results_batched = []
      for idx in range(len(utterances) // batchsize):
          agents = [dialogpt.clone() for _ in range(batchsize)]
          batch = utterances[idx * batchsize : (idx + 1) * batchsize]
          obs = []
          for i, a in enumerate(agents):
              obs.append(
                  a.observe({"text": batch[i], "episode_done": True})
              )
          generations = [x["text"] for x in dialogpt.batch_act(obs)]
          results_batched += generations
  
      assert results_single == results_batched
  
file_path: ParlAI/tests/nightly/gpu/test_dialogpt.py
imports: import unittest
  import parlai.utils.testing
  from parlai.core.agents import create_agent
label_desc: Use image node_id 1 for calling the TestDialogptModel obj's underlying member method code with example usage: obj._test_batchsize(batchsize, add_start_token) without return types