class_docstr: Buffer to store the data from the games played by the MCTS agent.
docstr: Adds a played game to the buffer.
  
  Args:
      states (List[torch.Tensor]): Observed game states.
      policies (List[torch.Tensor]): List of policies.
      rewards (List[torch.Tensor]): Observed rewards.
docstr_tok: ["Adds","a","played","game","to","the","buffer",".","Args",":","states","(","List","[","torch.Tensor","]",")",":","Observed","game","states",".","policies","(","List","[","torch.Tensor","]",")",":","List","of","policies",".","rewards","(","List","[","torch.Tensor","]",")",":","Observed","rewards","."]
code: def add_game(
      self,
      states: List[torch.Tensor],
      policies: List[torch.Tensor],
      rewards: List[torch.Tensor],
  ):
      """Adds a played game to the buffer.
  
      Args:
          states (List[torch.Tensor]): Observed game states.
          policies (List[torch.Tensor]): List of policies.
          rewards (List[torch.Tensor]): Observed rewards.
      """
      self.game_data[self.num_games] = len(states)
      torch.save(
          states,
          os.path.join(self.temp_dir, f"states_{self.num_games}.pt"),
      )
      torch.save(
          policies,
          os.path.join(self.temp_dir, f"policies_{self.num_games}.pt"),
      )
      torch.save(
          rewards,
          os.path.join(self.temp_dir, f"rewards_{self.num_games}.pt"),
      )
      self.num_games += 1
      if self.num_games >= self.max_buffer_size:
          # remove oldest game. Note that this line is not thread safe. Lock
          # should be added if multiple threads are used.
          self.num_games = 0
  
imports: import json
  import os
  import shutil
  import tempfile
  from pathlib import Path
  from typing import List, Tuple
  import numpy
  import torch
  from torch.utils.data import Dataset
  from open_alpha_tensor.core.data.generation import generate_synthetic_data
  from open_alpha_tensor.core.data.utils import get_scalars, map_triplet_to_action
label_desc: Use image node_id 3 for calling the GameDataBuffer obj's underlying member method code with example usage: obj.add_game(states, policies, rewards) without return types