code: def learn_on_batch(self, postprocessed_batch):
      train_batch = self._lazy_tensor_dict(postprocessed_batch)
      unflattened_obs = restore_original_dimensions(
          train_batch[SampleBatch.CUR_OBS],
          self.observation_space,
          self.framework,
      )
  
      info = {}
  
      start = time.time()
      self.model.partial_fit(
          unflattened_obs,
          train_batch[SampleBatch.REWARDS],
          train_batch[SampleBatch.ACTIONS],
      )
  
      infos = postprocessed_batch["infos"]
      if "regret" in infos[0]:
          regret = sum(
              row["infos"]["regret"]
              for row in postprocessed_batch.rows()
          )
          self.regrets.append(regret)
          info["cumulative_regret"] = sum(self.regrets)
      else:
          if log_once("no_regrets"):
              logger.warning(
                  "The env did not report `regret` values in "
                  "its `info` return, ignoring."
              )
      info["update_latency"] = time.time() - start
      return {LEARNER_STATS_KEY: info}
  
file_path: ray/rllib_contrib/bandit/src/rllib_bandit/bandit/bandit_torch_policy.py
imports: import logging
  import time
  from gymnasium import spaces
  from rllib_bandit.bandit.bandit_torch_model import DiscreteLinearModel, DiscreteLinearModelThompsonSampling, DiscreteLinearModelUCB, ParametricLinearModelThompsonSampling, ParametricLinearModelUCB
  from ray.rllib.models.catalog import ModelCatalog
  from ray.rllib.models.modelv2 import restore_original_dimensions
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.policy.torch_policy_v2 import TorchPolicyV2
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.metrics.learner_info import LEARNER_STATS_KEY
  from ray.util.debug import log_once
label_desc: Use image node_id 3 for calling the BanditTorchPolicy obj's underlying member method code with example usage: obj.learn_on_batch(postprocessed_batch) and returns: dict