class_docstr: EXPERIMENTAL Given a trace of training data, replay a model with batched
  sites extended to include both training and forecast time, using the guide
  trace for the training prefix and samples from the prior on the forecast
  postfix.
  
  :param trace: a guide trace.
  :type trace: ~pyro.poutine.trace_struct.Trace
class_docstr_tok: ["EXPERIMENTAL","Given","a","trace","of","training","data",",","replay","a","model","with","batched","sites","extended","to","include","both","training","and","forecast","time",",","using","the","guide","trace","for","the","training","prefix","and","samples","from","the","prior","on","the","forecast","postfix",".",":","param","trace",":","a","guide","trace",".",":","type","trace",":","~pyro.poutine.trace_struct.Trace"]
code: def _pyro_post_sample(self, msg):
      if site_is_subsample(msg):
          return
  
      name = msg["name"]
      if name not in self.trace:
          return
  
      model_value = msg["value"]
      guide_value = self.trace.nodes[name]["value"]
      if model_value.shape == guide_value.shape:
          msg["value"] = guide_value
          return
  
      # Search for a single dim with mismatched size.
      assert model_value.dim() == guide_value.dim()
      for dim in range(model_value.dim()):
          if model_value.size(dim) != guide_value.size(dim):
              break
      assert model_value.size(dim) > guide_value.size(dim)
      assert (
          model_value.shape[dim + 1 :] == guide_value.shape[dim + 1 :]
      )
      split = guide_value.size(dim)
      index = (slice(None),) * dim + (slice(split, None),)
      msg["value"] = torch.cat(
          [guide_value, model_value[index]], dim=dim
      )
  
imports: import numbers
  from functools import singledispatch
  import torch
  from torch.distributions import transform_to, transforms
  import pyro.distributions
  from pyro.infer.reparam import DiscreteCosineReparam, HaarReparam
  from pyro.poutine.messenger import Messenger
  from pyro.poutine.util import site_is_subsample
  from pyro.primitives import get_param_store
label_desc: Use image node_id 2 for calling the PrefixReplayMessenger obj's underlying member method code with example usage: obj._pyro_post_sample(msg) without return types