class_docstr: Hypervolume computation dimension sweep algorithm from [Fonseca2006]_.
  
  Adapted from Simon Wessing's implementation of the algorithm
  (Variant 3, Version 1.2) in [Fonseca2006]_ in PyMOO:
  https://github.com/msu-coinlab/pymoo/blob/master/pymoo/vendor/hv.py
  
  Maximization is assumed.
  
  TODO: write this in C++ for faster looping.
class_docstr_tok: ["Hypervolume","computation","dimension","sweep","algorithm","from","[","Fonseca2006","]","_",".","Adapted","from","Simon","Wessing","'s","implementation","of","the","algorithm","(","Variant","3",",","Version","1.2",")","in","[","Fonseca2006","]","_","in","PyMOO",":","https",":","\/\/github.com\/msu-coinlab\/pymoo\/blob\/master\/pymoo\/vendor\/hv.py","Maximization","is","assumed",".","TODO",":","write","this","in","C++","for","faster","looping","."]
docstr: Compute hypervolume.
  
  Args:
      pareto_Y: A `n x m`-dim tensor of pareto optimal outcomes
  
  Returns:
      The hypervolume.
docstr_tok: ["Compute","hypervolume",".","Args",":","pareto_Y",":","A","`","n","x","m","`","-dim","tensor","of","pareto","optimal","outcomes","Returns",":","The","hypervolume","."]
code: def compute(self, pareto_Y: Tensor) -> float:
      r"""Compute hypervolume.
  
      Args:
          pareto_Y: A `n x m`-dim tensor of pareto optimal outcomes
  
      Returns:
          The hypervolume.
      """
      if pareto_Y.shape[-1] != self._ref_point.shape[0]:
          raise BotorchTensorDimensionError(
              "pareto_Y must have the same number of objectives as ref_point. "
              f"Got {pareto_Y.shape[-1]}, expected {self._ref_point.shape[0]}."
          )
      elif pareto_Y.ndim != 2:
          raise BotorchTensorDimensionError(
              f"pareto_Y must have exactly two dimensions, got {pareto_Y.ndim}."
          )
      # This assumes maximization, but internally flips the sign of the pareto front
      # and the reference point and computes hypervolume for the minimization problem.
      pareto_Y = -pareto_Y
      better_than_ref = (pareto_Y <= self._ref_point).all(dim=-1)
      pareto_Y = pareto_Y[better_than_ref]
      # shift the pareto front so that reference point is all zeros
      pareto_Y = pareto_Y - self._ref_point
      self._initialize_multilist(pareto_Y)
      bounds = torch.full_like(self._ref_point, float("-inf"))
      return self._hv_recursive(
          i=self._ref_point.shape[0] - 1,
          n_pareto=pareto_Y.shape[0],
          bounds=bounds,
      )
  
imports: from __future__ import annotations
  import warnings
  from copy import deepcopy
  from itertools import combinations
  from typing import Callable, List, Optional, Union
  import torch
  from botorch.acquisition.cached_cholesky import CachedCholeskyMCSamplerMixin
  from botorch.acquisition.multi_objective.objective import MCMultiOutputObjective
  from botorch.acquisition.multi_objective.utils import prune_inferior_points_multi_objective
  from botorch.exceptions.errors import BotorchError, BotorchTensorDimensionError, UnsupportedError
  from botorch.exceptions.warnings import BotorchWarning
  from botorch.models.model import Model
  from botorch.sampling.base import MCSampler
  from botorch.utils.multi_objective.box_decompositions.box_decomposition_list import BoxDecompositionList
  from botorch.utils.multi_objective.box_decompositions.dominated import DominatedPartitioning
  from botorch.utils.multi_objective.box_decompositions.non_dominated import FastNondominatedPartitioning, NondominatedPartitioning
  from botorch.utils.multi_objective.box_decompositions.utils import _pad_batch_pareto_frontier
  from botorch.utils.objective import compute_feasibility_indicator
  from botorch.utils.torch import BufferDict
  from torch import Tensor
label_desc: Use image node_id 4 for calling the Hypervolume obj's underlying member method code with example usage: obj.compute(pareto_Y) and returns: self