class_docstr: Given a stochastic function with param calls and a set of parameter values,
  create a stochastic function where all param calls are substituted with
  the fixed values.
  data should be a dict of names to values.
  Consider the following Pyro program:
  
      >>> def model(x):
      ...     a = pyro.param("a", torch.tensor(0.5))
      ...     x = pyro.sample("x", dist.Bernoulli(probs=a))
      ...     return x
      >>> substituted_model = pyro.poutine.substitute(model, data={"a": torch.tensor(0.3)})
  
  In this example, site `a` will now have value `torch.tensor(0.3)`.
  :param data: dictionary of values keyed by site names.
  :returns: ``fn`` decorated with a :class:`~pyro.poutine.substitute_messenger.SubstituteMessenger`
class_docstr_tok: ["Given","a","stochastic","function","with","param","calls","and","a","set","of","parameter","values",",","create","a","stochastic","function","where","all","param","calls","are","substituted","with","the","fixed","values",".","data","should","be","a","dict","of","names","to","values",".","Consider","the","following","Pyro","program",":",">",">",">","def","model","(","x",")",":","...","a","=","pyro.param","(","``","a","''",",","torch.tensor","(","0.5",")",")","...","x","=","pyro.sample","(","``","x","''",",","dist.Bernoulli","(","probs=a",")",")","...","return","x",">",">",">","substituted_model","=","pyro.poutine.substitute","(","model",",","data=","{","``","a","''",":","torch.tensor","(","0.3",")","}",")","In","this","example",",","site","`","a","`","will","now","have","value","`","torch.tensor","(","0.3",")","`",".",":","param","data",":","dictionary","of","values","keyed","by","site","names",".",":","returns",":","``","fn","``","decorated","with","a",":","class",":","`","~pyro.poutine.substitute_messenger.SubstituteMessenger","`"]
code: def _pyro_sample(self, msg: "Message") -> None:
      return None
  
file_path: pyro/pyro/poutine/substitute_messenger.py
imports: import warnings
  from typing import TYPE_CHECKING, Dict, Set
  from typing_extensions import Self
  from pyro import params
  from pyro.poutine.messenger import Messenger
  from pyro.poutine.util import is_validation_enabled
label_desc: Use image node_id 4 for calling the SubstituteMessenger obj's underlying member method code with example usage: obj._pyro_sample(msg) and returns: None