class_docstr: Basic tests on the util functions in TorchAgent.
class_docstr_tok: ["Basic","tests","on","the","util","functions","in","TorchAgent","."]
docstr: Make sure batch act calls the right step.
docstr_tok: ["Make","sure","batch","act","calls","the","right","step","."]
code: def test_batch_act(self):
      """
      Make sure batch act calls the right step.
      """
      agent = get_agent()
  
      obs_labs = [
          Message(
              {
                  "text": "It's only a flesh wound.",
                  "labels": ["Yield!"],
                  "episode_done": True,
              }
          ),
          Message(
              {
                  "text": "The needs of the many outweigh...",
                  "labels": ["The needs of the few."],
                  "episode_done": True,
              }
          ),
          Message(
              {
                  "text": "Hello there.",
                  "labels": ["General Kenobi."],
                  "episode_done": True,
              }
          ),
      ]
      obs_labs_vecs = []
      for o in obs_labs:
          agent.history.reset()
          agent.history.update_history(o)
          obs_labs_vecs.append(agent.vectorize(o, agent.history))
      reply = agent.batch_act(obs_labs_vecs)
      for i in range(len(obs_labs_vecs)):
          self.assertEqual(reply[i]["text"], "Training {}!".format(i))
  
      obs_elabs = [
          Message(
              {
                  "text": "It's only a flesh wound.",
                  "eval_labels": ["Yield!"],
                  "episode_done": True,
              }
          ),
          Message(
              {
                  "text": "The needs of the many outweigh...",
                  "eval_labels": ["The needs of the few."],
                  "episode_done": True,
              }
          ),
          Message(
              {
                  "text": "Hello there.",
                  "eval_labels": ["General Kenobi."],
                  "episode_done": True,
              }
          ),
      ]
      obs_elabs_vecs = []
      for o in obs_elabs:
          agent.history.reset()
          agent.history.update_history(o)
          obs_elabs_vecs.append(agent.vectorize(o, agent.history))
      reply = agent.batch_act(obs_elabs_vecs)
      for i in range(len(obs_elabs_vecs)):
          self.assertIn("Evaluating {}".format(i), reply[i]["text"])
  
imports: import os
  import unittest
  from parlai.core.agents import create_agent_from_shared
  from parlai.utils.testing import tempdir
  from parlai.utils.misc import Message
label_desc: Use image node_id 13 for calling the TestTorchAgent obj's underlying member method code with example usage: obj.test_batch_act() without return types