class_docstr: Vectorized plate implementation using :func:`~pyro.contrib.funsor.to_data` instead of
  :class:`~pyro.poutine.runtime._DimAllocator`.
class_docstr_tok: ["Vectorized","plate","implementation","using",":","func",":","`","~pyro.contrib.funsor.to_data","`","instead","of",":","class",":","`","~pyro.poutine.runtime._DimAllocator","`","."]
code: def __enter__(self):
      super().__enter__()  # do this first to take care of globals recycling
      name_to_dim = OrderedDict(
          [(self.name, DimRequest(self.dim, self.dim_type))]
      )
      indices = to_data(self._indices, name_to_dim=name_to_dim)
      # extract the dimension allocated by to_data to match plate's current behavior
      self.dim, self.indices = -indices.dim(), indices.reshape(-1)
      return self
  
imports: from collections import OrderedDict
  from numbers import Number
  import funsor
  from pyro.contrib.funsor.handlers.named_messenger import DimRequest, DimType, GlobalNamedMessenger, NamedMessenger
  from pyro.contrib.funsor.handlers.primitives import to_data, to_funsor
  from pyro.distributions.util import copy_docs_from
  from pyro.poutine.broadcast_messenger import BroadcastMessenger
  from pyro.poutine.indep_messenger import CondIndepStackFrame
  from pyro.poutine.messenger import Messenger
  from pyro.poutine.runtime import effectful
  from pyro.poutine.subsample_messenger import SubsampleMessenger
  from pyro.util import ignore_jit_warnings
label_desc: Use image node_id 2 for calling the IndepMessenger obj's underlying member method code with example usage: obj.__enter__() and returns: self