class_docstr: Base class for "easy guides", which are more flexible than
  :class:`~pyro.infer.AutoGuide` s, but are easier to write than raw Pyro guides.
  
  Derived classes should define a :meth:`guide` method. This :meth:`guide`
  method can combine ordinary guide statements (e.g. ``pyro.sample`` and
  ``pyro.param``) with the following special statements:
  
  - ``group = self.group(...)`` selects multiple ``pyro.sample`` sites in the
    model. See :class:`Group` for subsequent methods.
  - ``with self.plate(...): ...`` should be used instead of ``pyro.plate``.
  - ``self.map_estimate(...)`` uses a ``Delta`` guide for a single site.
  
  Derived classes may also override the :meth:`init` method to provide custom
  initialization for models sites.
  
  :param callable model: A Pyro model.
docstr: Construct a maximum a posteriori (MAP) guide using Delta distributions.
  
  :param str name: The name of a model sample site.
  :return: A sampled value.
  :rtype: torch.Tensor
docstr_tok: ["Construct","a","maximum","a","posteriori","(","MAP",")","guide","using","Delta","distributions",".",":","param","str","name",":","The","name","of","a","model","sample","site",".",":","return",":","A","sampled","value",".",":","rtype",":","torch.Tensor"]
code: def map_estimate(self, name):
      """
      Construct a maximum a posteriori (MAP) guide using Delta distributions.
  
      :param str name: The name of a model sample site.
      :return: A sampled value.
      :rtype: torch.Tensor
      """
      site = self.prototype_trace.nodes[name]
      fn = site["fn"]
      event_dim = fn.event_dim
      init_needed = not hasattr(self, name)
      if init_needed:
          init_value = site["value"].detach()
      with ExitStack() as stack:
          for frame in site["cond_indep_stack"]:
              plate = self.plate(frame.name)
              if plate not in runtime._PYRO_STACK:
                  stack.enter_context(plate)
              elif init_needed and plate.subsample_size < plate.size:
                  # Repeat the init_value to full size.
                  dim = plate.dim - event_dim
                  assert init_value.size(dim) == plate.subsample_size
                  ind = torch.arange(
                      plate.size, device=init_value.device
                  )
                  ind = ind % plate.subsample_size
                  init_value = init_value.index_select(dim, ind)
          if init_needed:
              setattr(
                  self,
                  name,
                  PyroParam(init_value, fn.support, event_dim),
              )
          value = getattr(self, name)
          return pyro.sample(
              name, dist.Delta(value, event_dim=event_dim)
          )
  
imports: import re
  import weakref
  from abc import ABCMeta, abstractmethod
  from contextlib import ExitStack
  import torch
  from torch.distributions import biject_to
  import pyro
  import pyro.distributions
  import pyro.poutine
  import pyro.poutine.runtime
  from pyro.distributions.util import broadcast_shape, sum_rightmost
  from pyro.infer.autoguide.guides import prototype_hide_fn
  from pyro.infer.autoguide.initialization import InitMessenger
  from pyro.nn.module import PyroModule, PyroParam
label_desc: Use image node_id 9 for calling the EasyGuide obj's underlying member method code with example usage: obj.map_estimate(name) and returns: pyro