docstr: Computes three types of Sobol indices:
  first order indices, total indices and second order indices (if specified ).
  
  Args:
      model: Botorch model.
      bounds: `2 x d` parameter bounds over which to evaluate model sensitivity.
      num_gp_samples: If method is "GP samples", the number of GP samples
          has to be set.
      num_mc_samples: The number of montecarlo grid samples
      second_order: If True, the second order indices are computed.
      input_qmc: If True, a qmc Sobol grid is use instead of uniformly random.
      gp_sample_qmc: If True, the posterior sampling is done using
          SobolQMCNormalSampler.
      num_bootstrap_samples: If bootstrap is true, the number of bootstraps has
          to be specified.
docstr_tok: ["Computes","three","types","of","Sobol","indices",":","first","order","indices",",","total","indices","and","second","order","indices","(","if","specified",")",".","Args",":","model",":","Botorch","model",".","bounds",":","`","2","x","d","`","parameter","bounds","over","which","to","evaluate","model","sensitivity",".","num_gp_samples",":","If","method","is","``","GP","samples","''",",","the","number","of","GP","samples","has","to","be","set",".","num_mc_samples",":","The","number","of","montecarlo","grid","samples","second_order",":","If","True",",","the","second","order","indices","are","computed",".","input_qmc",":","If","True",",","a","qmc","Sobol","grid","is","use","instead","of","uniformly","random",".","gp_sample_qmc",":","If","True",",","the","posterior","sampling","is","done","using","SobolQMCNormalSampler",".","num_bootstrap_samples",":","If","bootstrap","is","true",",","the","number","of","bootstraps","has","to","be","specified","."]
code: def __init__(
      self,
      model: Model,
      bounds: torch.Tensor,
      num_gp_samples: int = 10**3,
      num_mc_samples: int = 10**4,
      second_order: bool = False,
      input_qmc: bool = False,
      gp_sample_qmc: bool = False,
      num_bootstrap_samples: int = 1,
  ) -> None:
      r"""Computes three types of Sobol indices:
      first order indices, total indices and second order indices (if specified ).
  
      Args:
          model: Botorch model.
          bounds: `2 x d` parameter bounds over which to evaluate model sensitivity.
          num_gp_samples: If method is "GP samples", the number of GP samples
              has to be set.
          num_mc_samples: The number of montecarlo grid samples
          second_order: If True, the second order indices are computed.
          input_qmc: If True, a qmc Sobol grid is use instead of uniformly random.
          gp_sample_qmc: If True, the posterior sampling is done using
              SobolQMCNormalSampler.
          num_bootstrap_samples: If bootstrap is true, the number of bootstraps has
              to be specified.
      """
      self.model = model
      self.second_order = second_order
      self.input_qmc = input_qmc
      self.gp_sample_qmc = gp_sample_qmc
      # pyre-fixme[4]: Attribute must be annotated.
      self.bootstrap = num_bootstrap_samples > 1
      self.num_bootstrap_samples = num_bootstrap_samples
      self.num_mc_samples = num_mc_samples
      self.num_gp_samples = num_gp_samples
      self.sensitivity = SobolSensitivity(
          bounds=bounds,
          num_mc_samples=self.num_mc_samples,
          second_order=self.second_order,
          input_qmc=self.input_qmc,
          num_bootstrap_samples=self.num_bootstrap_samples,
          bootstrap_array=True,
      )
      # TODO: Ideally, we would reduce the memory consumption here as well
      # but this is a tricky since it uses joint posterior sampling.
      posterior = self.model.posterior(self.sensitivity.A_B_ABi)
      if self.gp_sample_qmc:
          sampler = SobolQMCNormalSampler(
              sample_shape=torch.Size([self.num_gp_samples]), seed=0
          )
          # pyre-fixme[4]: Attribute must be annotated.
          self.samples = sampler(posterior)
      else:
          with torch.no_grad():
              self.samples = posterior.rsample(
                  torch.Size([self.num_gp_samples])
              )
  
imports: from copy import deepcopy
  from typing import Any, Callable, Dict, List, Optional, Union
  import numpy
  import torch
  from ax.modelbridge.torch import TorchModelBridge
  from ax.models.torch.botorch import BotorchModel
  from ax.models.torch.botorch_modular.model import BoTorchModel
  from ax.utils.common.typeutils import checked_cast
  from botorch.models.model import Model, ModelList
  from botorch.posteriors.gpytorch import GPyTorchPosterior
  from botorch.sampling.normal import SobolQMCNormalSampler
  from botorch.utils.sampling import draw_sobol_samples
  from botorch.utils.transforms import unnormalize
  from torch import Tensor
label_desc: Use image node_id 1 to create a new SobolSensitivityGPSampling object from inherited base classes: object with example: obj = SobolSensitivityGPSampling(model, bounds, num_gp_samples, num_mc_samples, second_order, input_qmc, gp_sample_qmc, num_bootstrap_samples)