class_docstr: A posterior based on a PyTorch Distribution.
  
  NOTE: For any attribute that is not explicitly defined on the Posterior level, this
  returns the corresponding attribute of the distribution. This allows easy access
  to the distribution attributes, without having to expose them on the Posterior.
class_docstr_tok: ["A","posterior","based","on","a","PyTorch","Distribution",".","NOTE",":","For","any","attribute","that","is","not","explicitly","defined","on","the","Posterior","level",",","this","returns","the","corresponding","attribute","of","the","distribution",".","This","allows","easy","access","to","the","distribution","attributes",",","without","having","to","expose","them","on","the","Posterior","."]
docstr: A posterior based on a PyTorch Distribution.
  
  Args:
      distribution: A PyTorch Distribution object.
docstr_tok: ["A","posterior","based","on","a","PyTorch","Distribution",".","Args",":","distribution",":","A","PyTorch","Distribution","object","."]
code: def __init__(self, distribution: Distribution) -> None:
      r"""A posterior based on a PyTorch Distribution.
  
      Args:
          distribution: A PyTorch Distribution object.
      """
      self.distribution = distribution
      # Get the device and dtype from distribution attributes.
      for attr in vars(distribution).values():
          if isinstance(attr, Tensor):
              self._device = attr.device
              self._dtype = attr.dtype
              break
  
file_path: botorch/botorch/posteriors/torch.py
imports: from __future__ import annotations
  from typing import Any, Dict, Optional
  import torch
  from botorch.posteriors.posterior import Posterior
  from torch import Tensor
  from torch.distributions.distribution import Distribution
label_desc: Use image node_id 1 to create a new TorchPosterior object from inherited base classes: Posterior with example: obj = TorchPosterior(distribution)