code: def learn_on_batch(self, postprocessed_batch):
      train_batch = self._lazy_tensor_dict(postprocessed_batch)
  
      loss_out, policy_loss, value_loss = self._loss(
          self, self.model, self.dist_class, train_batch
      )
      self._optimizers[0].zero_grad()
      loss_out.backward()
  
      grad_process_info = self.extra_grad_process(
          self._optimizers[0], loss_out
      )
      self._optimizers[0].step()
  
      grad_info = self.extra_grad_info(train_batch)
      grad_info.update(grad_process_info)
      grad_info.update(
          {
              "total_loss": loss_out.detach().cpu().numpy(),
              "policy_loss": policy_loss.detach().cpu().numpy(),
              "value_loss": value_loss.detach().cpu().numpy(),
          }
      )
  
      return {LEARNER_STATS_KEY: grad_info}
  
file_path: ray/rllib_contrib/leela_chess_zero/src/rllib_leela_chess_zero/leela_chess_zero/leela_chess_zero_policy.py
imports: import numpy
  from rllib_leela_chess_zero.leela_chess_zero.mcts import Node, RootParentNode
  from ray.rllib.policy.policy import Policy
  from ray.rllib.policy.torch_policy import TorchPolicy
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.framework import try_import_torch
  from ray.rllib.utils.metrics.learner_info import LEARNER_STATS_KEY
label_desc: Use image node_id 5 for calling the LeelaChessZeroPolicy obj's underlying member method code with example usage: obj.learn_on_batch(postprocessed_batch) and returns: dict