code: def _calc_weight_reward_tensors(
      self,
      input: BanditsEstimatorInput,
      eval_samples: Sequence[LogSample],
  ) -> Tuple[
      torch.Tensor,
      torch.Tensor,
      torch.Tensor,
      torch.Tensor,
      torch.Tensor,
      torch.Tensor,
      torch.Tensor,
      RunningAverage,
      RunningAverage,
  ]:
      n = len(eval_samples)
      ws = torch.ones((n, len(input.action_space)))
      rs = torch.zeros((n, 1))
      r_est = torch.zeros((n, len(input.action_space)))
      r_est_for_logged_action = torch.zeros((n, 1))
      actions = torch.zeros((n, len(input.action_space)))
      expected_rmax = torch.zeros((n, len(input.action_space)))
      propensities = torch.zeros((n, len(input.action_space)))
  
      log_avg = RunningAverage()
      gt_avg = RunningAverage()
  
      priori_rmax = (
          self._estimate_rmax(input)
          if self._rmax is None
          else self._rmax
      )
      assert priori_rmax is not None
  
      for i, sample in enumerate(eval_samples):
          (
              dm_score_for_logged_action,
              dm_scores,
              dm_probs,
          ) = self._calc_dm_reward(input.action_space, sample)
          for a in input.action_space:
              weight = (
                  0.0
                  if sample.log_action_probabilities[a]
                  < PROPENSITY_THRESHOLD
                  else sample.tgt_action_probabilities[a]
                  / sample.log_action_probabilities[a]
              )
              ws[i, a] = self._weight_clamper(weight)
              propensities[i, a] = sample.tgt_action_probabilities[a]
              expected_rmax[i, a] = (
                  sample.tgt_action_probabilities[a] * priori_rmax
              )
              actions[i, a] = float(a == sample.log_action)
  
          rs[i, 0] = sample.log_reward
          r_est[i] = dm_scores.reshape(-1)
          # pyre-fixme[6]: For 2nd param expected `Union[bool, float, int,
          #  Tensor]` but got `Optional[float]`.
          r_est_for_logged_action[i] = dm_score_for_logged_action
          log_avg.add(sample.log_reward)
          gt_avg.add(sample.ground_truth_reward)
  
      return (
          actions,
          ws,
          rs,
          r_est,
          r_est_for_logged_action,
          propensities,
          expected_rmax,
          log_avg,
          gt_avg,
      )
  
imports: import logging
  import time
  from abc import ABC, abstractmethod
  from dataclasses import dataclass
  from typing import Optional, Sequence, Tuple, Union
  import numpy
  import torch
  from reagent.ope.estimators.estimator import Estimator, EstimatorResult
  from reagent.ope.estimators.types import Action, ActionDistribution, ActionSpace, Reward, Trainer, TrainingData, Values
  from reagent.ope.utils import Clamper, RunningAverage
  from torch import Tensor
label_desc: Use image node_id 3 for calling the SwitchEstimator obj's underlying member method code with example usage: obj._calc_weight_reward_tensors(input, eval_samples) and returns: actions,  ws,  rs,  r_est,  r_est_for_logged_action,  propensities,  expected_rmax,  log_avg,  gt_avg