docstr: create a replay memory for off-policy RL or offline RL.
  
  Args:
      max_size (int): max size of replay memory
      obs_dim (list or tuple): observation shape
      act_dim (list or tuple): action shape
docstr_tok: ["create","a","replay","memory","for","off-policy","RL","or","offline","RL",".","Args",":","max_size","(","int",")",":","max","size","of","replay","memory","obs_dim","(","list","or","tuple",")",":","observation","shape","act_dim","(","list","or","tuple",")",":","action","shape"]
code: def __init__(self, max_size, obs_dim, act_dim):
      """create a replay memory for off-policy RL or offline RL.
  
      Args:
          max_size (int): max size of replay memory
          obs_dim (list or tuple): observation shape
          act_dim (list or tuple): action shape
      """
      self.max_size = int(max_size)
      self.obs_dim = obs_dim
      self.act_dim = act_dim
  
      self.obs = np.zeros((max_size, obs_dim), dtype="float32")
      if act_dim == 0:  # Discrete control environment
          self.action = np.zeros((max_size,), dtype="int32")
      else:  # Continuous control environment
          self.action = np.zeros((max_size, act_dim), dtype="float32")
      self.reward = np.zeros((max_size,), dtype="float32")
      self.terminal = np.zeros((max_size,), dtype="bool")
      self.next_obs = np.zeros((max_size, obs_dim), dtype="float32")
  
      self._curr_size = 0
      self._curr_pos = 0
  
file_path: PARL/parl/utils/replay_memory.py
imports: import numpy
  from parl.utils import logger
label_desc: Use image node_id 1 to create a new ReplayMemory object from inherited base classes: object with example: obj = ReplayMemory(max_size, obs_dim, act_dim)