class_docstr: Interface for an off policy estimator for counterfactual evaluation.
class_docstr_tok: ["Interface","for","an","off","policy","estimator","for","counterfactual","evaluation","."]
docstr: Checks if we support off policy estimation (OPE) on given batch.
  
  Args:
      batch: The batch to check.
  
  Raises:
      ValueError: In case `action_prob` key is not in batch
docstr_tok: ["Checks","if","we","support","off","policy","estimation","(","OPE",")","on","given","batch",".","Args",":","batch",":","The","batch","to","check",".","Raises",":","ValueError",":","In","case","`","action_prob","`","key","is","not","in","batch"]
code: def check_action_prob_in_batch(self, batch: SampleBatchType) -> None:
      """Checks if we support off policy estimation (OPE) on given batch.
  
      Args:
          batch: The batch to check.
  
      Raises:
          ValueError: In case `action_prob` key is not in batch
      """
  
      if "action_prob" not in batch:
          raise ValueError(
              "Off-policy estimation is not possible unless the inputs "
              "include action probabilities (i.e., the policy is stochastic "
              "and emits the 'action_prob' key). For DQN this means using "
              "`exploration_config: {type: 'SoftQ'}`. You can also set "
              "`off_policy_estimation_methods: {}` to disable estimation."
          )
  
imports: import gymnasium
  import numpy
  import tree
  from typing import Dict, Any, List
  import logging
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.policy import Policy
  from ray.rllib.policy.sample_batch import convert_ma_batch_to_sample_batch
  from ray.rllib.utils.policy import compute_log_likelihoods_from_input_dict
  from ray.rllib.utils.annotations import DeveloperAPI, ExperimentalAPI, OverrideToImplementCustomLogic
  from ray.rllib.utils.deprecation import Deprecated
  from ray.rllib.utils.numpy import convert_to_numpy
  from ray.rllib.utils.typing import TensorType, SampleBatchType
  from ray.rllib.offline.offline_evaluator import OfflineEvaluator
label_desc: Use image node_id 8 for calling the OffPolicyEstimator obj's underlying member method code with example usage: obj.check_action_prob_in_batch(batch) without return types