class_docstr: ParlAI agent exported to TorchScript with JIT compilation and then loaded from disk.
  
  Metrics and batch act are currently unsupported, and CUDA is unsupported because
  TorchScripting is currently CPU-only.
code: def self_observe(self, self_message: Message) -> None:
      # TODO: support self._validate_self_observe_invariants() method of TorchAgent
  
      assert self.observation is not None
      if self.observation["episode_done"]:
          # oh this was the last example in the episode. reset the history
          self.history = []
          # additionally mark the last observation as invalid
          self.observation = None
      else:
          self.history.append(self_message["text"])
  
file_path: ParlAI/parlai/torchscript/agents.py
imports: from typing import List
  import torch
  from parlai.core.agents import Agent
  from parlai.core.message import Message
  from parlai.core.opt import Opt
  from parlai.utils.io import PathManager
label_desc: Use image node_id 4 for calling the TorchScriptAgent obj's underlying member method code with example usage: obj.self_observe(_message) without return types