class_docstr: Batch Hypervolume Knowledge Gradient using one-shot optimization.
  
  The hypervolume knowledge gradient seeks to maximize the difference in
  hypervolume of the hypervolume-maximizing set of a fixed size after
  conditioning the unknown observation(s) that would be recevied if X where
  evalauted. See [Daulton2023hvkg]_ for details.
  
  This computes the batch Hypervolume Knowledge Gradient using fantasies for
  the outer expectation and MC-sampling for the inner expectation.
  
  In addition to the design variables, the input `X` also includes variables
  for the optimal designs for each of the fantasy models (Note this is
  `N x N_pareto` optimal designs). For a fixed number of fantasies, all points
  in `X` can be optimized in a "one-shot" fashion.
class_docstr_tok: ["Batch","Hypervolume","Knowledge","Gradient","using","one-shot","optimization",".","The","hypervolume","knowledge","gradient","seeks","to","maximize","the","difference","in","hypervolume","of","the","hypervolume-maximizing","set","of","a","fixed","size","after","conditioning","the","unknown","observation","(","s",")","that","would","be","recevied","if","X","where","evalauted",".","See","[","Daulton2023hvkg","]","_","for","details",".","This","computes","the","batch","Hypervolume","Knowledge","Gradient","using","fantasies","for","the","outer","expectation","and","MC-sampling","for","the","inner","expectation",".","In","addition","to","the","design","variables",",","the","input","`","X","`","also","includes","variables","for","the","optimal","designs","for","each","of","the","fantasy","models","(","Note","this","is","`","N","x","N_pareto","`","optimal","designs",")",".","For","a","fixed","number","of","fantasies",",","all","points","in","`","X","`","can","be","optimized","in","a","``","one-shot","''","fashion","."]
docstr: We only return X as the set of candidates post-optimization.
  
  Args:
      X_full: A `b x (q + num_fantasies) x d`-dim Tensor with `b`
          t-batches of `q + num_fantasies` design points each.
  
  Returns:
      A `b x q x d`-dim Tensor with `b` t-batches of `q` design points each.
docstr_tok: ["We","only","return","X","as","the","set","of","candidates","post-optimization",".","Args",":","X_full",":","A","`","b","x","(","q","+","num_fantasies",")","x","d","`","-dim","Tensor","with","`","b","`","t-batches","of","`","q","+","num_fantasies","`","design","points","each",".","Returns",":","A","`","b","x","q","x","d","`","-dim","Tensor","with","`","b","`","t-batches","of","`","q","`","design","points","each","."]
code: def extract_candidates(self, X_full: Tensor) -> Tensor:
      r"""We only return X as the set of candidates post-optimization.
  
      Args:
          X_full: A `b x (q + num_fantasies) x d`-dim Tensor with `b`
              t-batches of `q + num_fantasies` design points each.
  
      Returns:
          A `b x q x d`-dim Tensor with `b` t-batches of `q` design points each.
      """
      return X_full[..., : -self.num_pseudo_points, :]
  
imports: from copy import deepcopy
  from typing import Any, Callable, Dict, List, Optional, Tuple, Type
  import torch
  from botorch import settings
  from botorch.acquisition.acquisition import AcquisitionFunction, OneShotAcquisitionFunction
  from botorch.acquisition.cost_aware import CostAwareUtility
  from botorch.acquisition.decoupled import DecoupledAcquisitionFunction
  from botorch.acquisition.knowledge_gradient import ProjectedAcquisitionFunction
  from botorch.acquisition.multi_objective.monte_carlo import MultiObjectiveMCAcquisitionFunction, qExpectedHypervolumeImprovement
  from botorch.acquisition.multi_objective.objective import MCMultiOutputObjective
  from botorch.exceptions.errors import UnsupportedError
  from botorch.models.deterministic import PosteriorMeanModel
  from botorch.models.model import Model
  from botorch.sampling.base import MCSampler
  from botorch.sampling.list_sampler import ListSampler
  from botorch.sampling.normal import SobolQMCNormalSampler
  from botorch.sampling.stochastic_samplers import StochasticSampler
  from botorch.utils.multi_objective.box_decompositions.non_dominated import FastNondominatedPartitioning
  from botorch.utils.transforms import match_batch_shape, t_batch_mode_transform
  from torch import Tensor
label_desc: Use image node_id 5 for calling the qHypervolumeKnowledgeGradient obj's underlying member method code with example usage: obj.extract_candidates(X_full) and returns: X_full