class_docstr: Agent of Cartpole env.
  
  Args:
      algorithm(parl.Algorithm): algorithm used to solve the problem.
docstr: Update model with an episode data
  
  Args:
      obs(np.float32): shape of (batch_size, obs_dim)
      action(np.int64): shape of (batch_size)
      reward(np.float32): shape of (batch_size)
  
  Returns:
      loss(float)
code: def learn(self, obs, action, reward):
      """Update model with an episode data
  
      Args:
          obs(np.float32): shape of (batch_size, obs_dim)
          action(np.int64): shape of (batch_size)
          reward(np.float32): shape of (batch_size)
  
      Returns:
          loss(float)
  
      """
      obs = torch.tensor(obs, device=self.device, dtype=torch.float)
      action = torch.tensor(
          action, device=self.device, dtype=torch.long
      )
      reward = torch.tensor(
          reward, device=self.device, dtype=torch.float
      )
  
      loss = self.alg.learn(obs, action, reward)
      return loss.item()
  
file_path: PARL/benchmark/torch/QuickStart/cartpole_agent.py
imports: import parl
  import torch
  import numpy
label_desc: Use image node_id 4 for calling the CartpoleAgent obj's underlying member method code with example usage: obj.learn(obs, action, reward) and returns: loss