code: def _get_sample_weight(self, batch: rlt.BanditRewardModelInput):
      weight = None
      if self.weighted_by_inverse_propensity:
          assert batch.action_prob is not None
          # pyre-fixme[58]: `/` is not supported for operand types `float` and
          #  `Tensor`.
          weight = 1.0 / batch.action_prob
      return weight
  
imports: import logging
  from typing import Optional
  import numpy
  import reagent.core.types
  import torch
  from reagent.core.dataclasses import field
  from reagent.models.base import ModelBase
  from reagent.optimizer.union import Optimizer__Union
  from reagent.training.reagent_lightning_module import ReAgentLightningModule
  from reagent.training.reward_network_trainer import _get_loss_function, LossFunction
label_desc: Use image node_id 3 for calling the BanditRewardNetTrainer obj's underlying member method code with example usage: obj._get_sample_weight(batch) and returns: weight