class_docstr: A Mixin class that adds q-subset index computations and caching.
class_docstr_tok: ["A","Mixin","class","that","adds","q-subset","index","computations","and","caching","."]
docstr: Returns and caches a dict of indices equal to subsets of `{1, ..., q_out}`.
  
  This means that consecutive calls to `self.compute_q_subset_indices` with
  the same `q_out` do not recompute the indices for all (2^q_out - 1) subsets.
  
  NOTE: This will use more memory than regenerating the indices
  for each i and then deleting them, but it will be faster for
  repeated evaluations (e.g. during optimization).
  
  Args:
      q_out: The batch size of the objectives. This is typically equal
          to the q-batch size of `X`. However, if using a set valued
          objective (e.g., MVaR) that produces `s` objective values for
          each point on the q-batch of `X`, we need to properly account
          for each objective while calculating the hypervolume contributions
          by using `q_out = q * s`.
  
  Returns:
      A dict that maps "q choose i" to all size-i subsets of `{1, ..., q_out}`.
docstr_tok: ["Returns","and","caches","a","dict","of","indices","equal","to","subsets","of","`","{","1",",","...",",","q_out","}","`",".","This","means","that","consecutive","calls","to","`","self.compute_q_subset_indices","`","with","the","same","`","q_out","`","do","not","recompute","the","indices","for","all","(","2^q_out","-","1",")","subsets",".","NOTE",":","This","will","use","more","memory","than","regenerating","the","indices","for","each","i","and","then","deleting","them",",","but","it","will","be","faster","for","repeated","evaluations","(","e.g",".","during","optimization",")",".","Args",":","q_out",":","The","batch","size","of","the","objectives",".","This","is","typically","equal","to","the","q-batch","size","of","`","X","`",".","However",",","if","using","a","set","valued","objective","(","e.g.",",","MVaR",")","that","produces","`","s","`","objective","values","for","each","point","on","the","q-batch","of","`","X","`",",","we","need","to","properly","account","for","each","objective","while","calculating","the","hypervolume","contributions","by","using","`","q_out","=","q","*","s","`",".","Returns",":","A","dict","that","maps","``","q","choose","i","''","to","all","size-i","subsets","of","`","{","1",",","...",",","q_out","}","`","."]
code: def compute_q_subset_indices(
      self, q_out: int, device: torch.device
  ) -> BufferDict[str, Tensor]:
      r"""Returns and caches a dict of indices equal to subsets of `{1, ..., q_out}`.
  
      This means that consecutive calls to `self.compute_q_subset_indices` with
      the same `q_out` do not recompute the indices for all (2^q_out - 1) subsets.
  
      NOTE: This will use more memory than regenerating the indices
      for each i and then deleting them, but it will be faster for
      repeated evaluations (e.g. during optimization).
  
      Args:
          q_out: The batch size of the objectives. This is typically equal
              to the q-batch size of `X`. However, if using a set valued
              objective (e.g., MVaR) that produces `s` objective values for
              each point on the q-batch of `X`, we need to properly account
              for each objective while calculating the hypervolume contributions
              by using `q_out = q * s`.
  
      Returns:
          A dict that maps "q choose i" to all size-i subsets of `{1, ..., q_out}`.
      """
      if q_out != self.q_out:
          self.q_subset_indices = compute_subset_indices(
              q_out, device=device
          )
          self.q_out = q_out
      return self.q_subset_indices
  
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 2 for calling the SubsetIndexCachingMixin obj's underlying member method code with example usage: obj.compute_q_subset_indices(q_out, device) and returns: self