class_docstr: Ensemble posterior, that should be used for ensemble models that compute
  eagerly a finite number of samples per X value as for example a deep ensemble
  or a random forest.
class_docstr_tok: ["Ensemble","posterior",",","that","should","be","used","for","ensemble","models","that","compute","eagerly","a","finite","number","of","samples","per","X","value","as","for","example","a","deep","ensemble","or","a","random","forest","."]
docstr: The variance of the posterior as a `(b) x n x m`-dim Tensor.
  
  Computed as the sample variance across the ensemble outputs.
docstr_tok: ["The","variance","of","the","posterior","as","a","`","(","b",")","x","n","x","m","`","-dim","Tensor",".","Computed","as","the","sample","variance","across","the","ensemble","outputs","."]
code: def variance(self) -> Tensor:
      r"""The variance of the posterior as a `(b) x n x m`-dim Tensor.
  
      Computed as the sample variance across the ensemble outputs.
      """
      if self.ensemble_size == 1:
          return torch.zeros_like(self.values.squeeze(-3))
      return self.values.var(dim=-3)
  
file_path: botorch/botorch/posteriors/ensemble.py
imports: from __future__ import annotations
  from typing import Optional
  import torch
  from botorch.posteriors.posterior import Posterior
  from torch import Tensor
label_desc: Use image node_id 7 for calling the EnsemblePosterior obj's underlying member method code with example usage: obj.variance() and returns: self, torch