docstr: rmax is an a priori upper bound on any possible reward.
  The tighter the bound, the better the estimator can estimate
  its bias. If not provided, the estimator will use the max
  reward seen in the sample data.
docstr_tok: ["rmax","is","an","a","priori","upper","bound","on","any","possible","reward",".","The","tighter","the","bound",",","the","better","the","estimator","can","estimate","its","bias",".","If","not","provided",",","the","estimator","will","use","the","max","reward","seen","in","the","sample","data","."]
code: def __init__(
      self,
      trainer: Optional[Trainer] = None,
      weight_clamper: Optional[Clamper] = None,
      rmax: Optional[Reward] = None,
      device=None,
  ):
      """
      rmax is an a priori upper bound on any possible reward.
      The tighter the bound, the better the estimator can estimate
      its bias. If not provided, the estimator will use the max
      reward seen in the sample data.
      """
      super().__init__(trainer, device)
      self._rmax = rmax
      self._weight_clamper = (
          Clamper() if weight_clamper is None else weight_clamper
      )
  
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 1 to create a new SwitchEstimator object from inherited base classes: DMEstimator with example: obj = SwitchEstimator(trainer, weight_clamper, rmax, device)