code: def validation_step(
      self, batch: rlt.BanditRewardModelInput, batch_idx: int
  ):
      if self._training_batch_type and isinstance(batch, dict):
          batch = self._training_batch_type.from_dict(batch)
  
      weight = self._get_sample_weight(batch)
      loss = self.reward_net.sample_elbo(
          torch.cat([batch.action, batch.state.float_features], 1),
          batch.reward,
          1,
      )
  
      detached_loss = loss.detach().cpu()
      self.reporter.log(eval_loss=detached_loss)
  
      if weight is not None:
          raise NotImplementedError  # TODO for integration in to RL framework
          # unweighted_loss = self._compute_unweighted_loss(pred_reward, reward, batch)
          # self.reporter.log(eval_unweighted_loss=unweighted_loss)
  
      return detached_loss.item()
  
file_path: ReAgent/reagent/training/cfeval/bayes_by_backprop_trainer.py
imports: import logging
  import reagent.core.types
  import torch
  from reagent.training.cfeval.bandit_reward_network_trainer import BanditRewardNetTrainer
label_desc: Use image node_id 2 for calling the BayesByBackpropTrainer obj's underlying member method code with example usage: obj.validation_step(batch, batch_idx) and returns: detached_loss