class_docstr: Agent.
  Args:
      algorithm (`parl.Algorithm`): algorithm to be used in this agent.
class_docstr_tok: ["Agent",".","Args",":","algorithm","(","`","parl.Algorithm","`",")",":","algorithm","to","be","used","in","this","agent","."]
docstr: Updating network
  Args:
      obs (np.array): representation of current observation
      act (np.array): current action
      value (np.array): state value
      returns (np.array): discounted return
      log_prob (np.array): the log probabilities of action
      adv (np.array): advantage value
docstr_tok: ["Updating","network","Args",":","obs","(","np.array",")",":","representation","of","current","observation","act","(","np.array",")",":","current","action","value","(","np.array",")",":","state","value","returns","(","np.array",")",":","discounted","return","log_prob","(","np.array",")",":","the","log","probabilities","of","action","adv","(","np.array",")",":","advantage","value"]
code: def learn(self, obs, act, value, returns, log_prob, adv):
      """Updating network
      Args:
          obs (np.array): representation of current observation
          act (np.array): current action
          value (np.array): state value
          returns (np.array): discounted return
          log_prob (np.array): the log probabilities of action
          adv (np.array): advantage value
      """
  
      obs = paddle.to_tensor(obs, dtype=paddle.float32)
      act = paddle.to_tensor(act, dtype=paddle.int32)
      value = paddle.to_tensor(value, dtype=paddle.float32)
      returns = paddle.to_tensor(returns, dtype=paddle.float32)
      log_prob = paddle.to_tensor(log_prob, dtype=paddle.float32)
      adv = paddle.to_tensor(adv, dtype=paddle.float32)
  
      value_loss, action_loss, entropy = self.alg.learn(
          obs, act, value, returns, log_prob, adv
      )
  
      return value_loss, action_loss, entropy
  
file_path: PARL/examples/Baselines/Halite_competition/paddle/rl_trainer/agent.py
imports: import os
  import parl
  import paddle
label_desc: Use image node_id 2 for calling the Agent obj's underlying member method code with example usage: obj.learn(obs, act, value, returns, log_prob, adv) and returns: value_loss,  action_loss,  entropy