class_docstr: Abstract base class for effect-based guides.
  
  Derived classes must implement the :meth:`get_posterior` method.
class_docstr_tok: ["Abstract","base","class","for","effect-based","guides",".","Derived","classes","must","implement","the",":","meth",":","`","get_posterior","`","method","."]
code: def _pyro_sample(self, msg: "Message") -> None:
      if msg["is_observed"] or site_is_subsample(msg):
          return
      if TYPE_CHECKING:
          assert isinstance(msg["name"], str)
          assert isinstance(msg["fn"], TorchDistributionMixin)
          assert msg["infer"] is not None
      prior = msg["fn"]
      msg["infer"]["prior"] = prior
      posterior = self.get_posterior(msg["name"], prior)
      if isinstance(posterior, torch.Tensor):
          posterior = dist.Delta(posterior, event_dim=prior.event_dim)
      if posterior.batch_shape != prior.batch_shape:
          posterior = posterior.expand(prior.batch_shape)
      msg["fn"] = posterior
  
file_path: pyro/pyro/poutine/guide.py
imports: from abc import ABC, abstractmethod
  from typing import TYPE_CHECKING, Callable, Dict, Optional, Tuple, Union
  import torch
  import pyro.distributions
  from pyro.poutine.trace_messenger import TraceMessenger
  from pyro.poutine.trace_struct import Trace
  from pyro.poutine.util import prune_subsample_sites, site_is_subsample
label_desc: Use image node_id 5 for calling the GuideMessenger obj's underlying member method code with example usage: obj._pyro_sample(msg) without return types