docstr: Computes the total Sobol indices:
  
  Returns:
      if num_bootstrap_samples>1
          Tensor: (values,var_mc,stderr_mc)x dim
      else
          Tensor: (values)x dim
docstr_tok: ["Computes","the","total","Sobol","indices",":","Returns",":","if","num_bootstrap_samples",">","1","Tensor",":","(","values",",","var_mc",",","stderr_mc",")","x","dim","else","Tensor",":","(","values",")","x","dim"]
code: def total_order_indices(self) -> Tensor:
      r"""Computes the total Sobol indices:
  
      Returns:
          if num_bootstrap_samples>1
              Tensor: (values,var_mc,stderr_mc)x dim
          else
              Tensor: (values)x dim
      """
      total_order_idxs = []
      for i in range(self.dim):
          vti = (
              0.5
              # pyre-fixme[58]: `-` is not supported for operand types
              #  `Optional[torch._tensor.Tensor]` and `Any`.
              # pyre-fixme[16]: `Optional` has no attribute `__getitem__`.
              * torch.mean(torch.pow(self.f_A - self.f_ABis[i], 2))
              / self.f_total_var
          )
          total_order_idxs.append(vti.unsqueeze(0))
      if not (self.bootstrap):
          total_order_idxs = torch.cat(total_order_idxs, dim=0).detach()
          return total_order_idxs
      else:
          total_order_idxs_btsp = [
              torch.cat(total_order_idxs, dim=0).unsqueeze(0)
          ]
          for b in range(self.num_bootstrap_samples):
              total_order_idxs = []
              for i in range(self.dim):
                  vti = (
                      0.5
                      * torch.mean(
                          torch.pow(
                              self.f_A_btsp[b] - self.f_ABis_btsp[b][i],
                              2,
                          )
                      )
                      / self.f_total_var_btsp[b]
                  )
                  total_order_idxs.append(vti.unsqueeze(0))
              total_order_idxs_btsp.append(
                  torch.cat(total_order_idxs, dim=0).unsqueeze(0)
              )
          total_order_idxs_btsp = torch.cat(
              total_order_idxs_btsp, dim=0
          )
          if self.bootstrap_array:
              return total_order_idxs_btsp.detach()
          else:
              return (
                  torch.cat(
                      [
                          total_order_idxs_btsp.mean(dim=0).unsqueeze(
                              0
                          ),
                          total_order_idxs_btsp.var(dim=0).unsqueeze(0),
                          torch.sqrt(
                              total_order_idxs_btsp.var(dim=0)
                              / (self.num_bootstrap_samples + 1)
                          ).unsqueeze(0),
                      ],
                      dim=0,
                  )
                  .t()
                  .detach()
              )
  
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 5 for calling the SobolSensitivity obj's underlying member method code with example usage: obj.total_order_indices() and returns: total_order_idxs, total_order_idxs_btsp, torch