class_docstr: Class for weighting acquisition functions by a prior distribution.
  
  Supports MC and batch acquisition functions via
  SampleReducingAcquisitionFunction.
  
  See [Hvarfner2022]_ for details.
docstr: Compute the acquisition function weighted by the prior.
docstr_tok: ["Compute","the","acquisition","function","weighted","by","the","prior","."]
code: def forward(self, X: Tensor) -> Tensor:
      r"""Compute the acquisition function weighted by the prior."""
      # batch_shape x q
      prior = self.prior_module(X)
      if self._is_sample_reducing_af:
          # sample_shape x batch_shape x q
          af_val = self.acq_func._non_reduced_forward(X)
      else:
          if prior.shape[-1] > 1:
              raise NotImplementedError(
                  "q-batches with q>1 are only supported using "
                  "SampleReducingMCAcquisitionFunction."
              )
          # batch_shape x q
          af_val = self.acq_func(X).unsqueeze(-1)
      if self._log:
          weighted_af_val = af_val + prior * self._prior_exponent
      else:
          weighted_af_val = af_val * prior.pow(self._prior_exponent)
      if self._is_sample_reducing_af:
          return self.acq_func._sample_reduction(
              self.acq_func._q_reduction(weighted_af_val)
          )
      return weighted_af_val.squeeze(-1)
  
file_path: botorch/botorch/acquisition/prior_guided.py
imports: from __future__ import annotations
  from typing import Optional
  from botorch.acquisition.acquisition import AcquisitionFunction
  from botorch.acquisition.monte_carlo import SampleReducingMCAcquisitionFunction
  from botorch.utils.transforms import concatenate_pending_points, t_batch_mode_transform
  from torch import Tensor
  from torch.nn import Module
label_desc: Use image node_id 2 for calling the PriorGuidedAcquisitionFunction obj's underlying member method code with example usage: obj.forward(X) and returns: weighted_af_val, self