class_docstr: A wrapper of :class:`~pyro.nn.module.PyroModule` whose parameters can be set
  constraints, set priors.
  
  By default, when we set a prior to a parameter, an auto Delta guide will be
  created. We can use the method :meth:`autoguide` to setup other auto guides.
  
  Example::
  
      >>> class Linear(Parameterized):
      ...     def __init__(self, a, b):
      ...         super().__init__()
      ...         self.a = Parameter(a)
      ...         self.b = Parameter(b)
      ...
      ...     def forward(self, x):
      ...         return self.a * x + self.b
      ...
      >>> linear = Linear(torch.tensor(1.), torch.tensor(0.))
      >>> linear.a = PyroParam(torch.tensor(1.), constraints.positive)
      >>> linear.b = PyroSample(dist.Normal(0, 1))
      >>> linear.autoguide("b", dist.Normal)
      >>> assert "a_unconstrained" in dict(linear.named_parameters())
      >>> assert "b_loc" in dict(linear.named_parameters())
      >>> assert "b_scale_unconstrained" in dict(linear.named_parameters())
  
  Note that by default, data of a parameter is a float :class:`torch.Tensor`
  (unless we use :func:`torch.set_default_dtype` to change default
  tensor type). To cast these parameters to a correct data type or GPU device,
  we can call methods such as :meth:`~torch.nn.Module.double` or
  :meth:`~torch.nn.Module.cuda`. See :class:`torch.nn.Module` for more
  information.
class_docstr_tok: ["A","wrapper","of",":","class",":","`","~pyro.nn.module.PyroModule","`","whose","parameters","can","be","set","constraints",",","set","priors",".","By","default",",","when","we","set","a","prior","to","a","parameter",",","an","auto","Delta","guide","will","be","created",".","We","can","use","the","method",":","meth",":","`","autoguide","`","to","setup","other","auto","guides",".","Example",":",":",">",">",">","class","Linear","(","Parameterized",")",":","...","def","__init__","(","self",",","a",",","b",")",":","...","super","(",")",".__init__","(",")","...","self.a","=","Parameter","(","a",")","...","self.b","=","Parameter","(","b",")","...","...","def","forward","(","self",",","x",")",":","...","return","self.a","*","x","+","self.b","...",">",">",">","linear","=","Linear","(","torch.tensor","(","1",".",")",",","torch.tensor","(","0",".",")",")",">",">",">","linear.a","=","PyroParam","(","torch.tensor","(","1",".",")",",","constraints.positive",")",">",">",">","linear.b","=","PyroSample","(","dist.Normal","(","0",",","1",")",")",">",">",">","linear.autoguide","(","``","b","''",",","dist.Normal",")",">",">",">","assert","``","a_unconstrained","''","in","dict","(","linear.named_parameters","(",")",")",">",">",">","assert","``","b_loc","''","in","dict","(","linear.named_parameters","(",")",")",">",">",">","assert","``","b_scale_unconstrained","''","in","dict","(","linear.named_parameters","(",")",")","Note","that","by","default",",","data","of","a","parameter","is","a","float",":","class",":","`","torch.Tensor","`","(","unless","we","use",":","func",":","`","torch.set_default_dtype","`","to","change","default","tensor","type",")",".","To","cast","these","parameters","to","a","correct","data","type","or","GPU","device",",","we","can","call","methods","such","as",":","meth",":","`","~torch.nn.Module.double","`","or",":","meth",":","`","~torch.nn.Module.cuda","`",".","See",":","class",":","`","torch.nn.Module","`","for","more","information","."]
code: def __init__(self):
      super().__init__()
      self._priors = OrderedDict()
      self._guides = OrderedDict()
      self._mode = "model"
  
imports: import warnings
  from collections import OrderedDict
  from functools import partial
  from torch.distributions import biject_to, constraints
  from torch.nn import Parameter
  import pyro
  import pyro.distributions
  from pyro.distributions.util import eye_like
  from pyro.nn.module import PyroModule, PyroParam, PyroSample, pyro_method
label_desc: Use image node_id 1 to create a new Parameterized object from inherited base classes: PyroModule with example: obj = Parameterized()