docstr: 根据训练数据更新一次模型参数
          
code: def learn(self, obs, act, reward):
      """根据训练数据更新一次模型参数"""
      act = np.expand_dims(act, axis=-1)
      reward = np.expand_dims(reward, axis=-1)
  
      obs = paddle.to_tensor(obs, dtype="float32")
      act = paddle.to_tensor(act, dtype="int32")
      reward = paddle.to_tensor(reward, dtype="float32")
  
      loss = self.alg.learn(obs, act, reward)
      return float(loss)
  
file_path: PARL/examples/tutorials/parl2_dygraph/lesson4/homework/policy_gradient_pong/agent.py
imports: import parl
  import paddle
  import numpy
label_desc: Use image node_id 4 for calling the Agent obj's underlying member method code with example usage: obj.learn(obs, act, reward) and returns: float