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 __init__(self, name=None, size=None, dim=None, indices=None):
      assert dim is None or dim < 0
      super().__init__()
      # without a name or dim, treat as a "vectorize" effect and allocate a non-visible dim
      self.dim_type = (
          DimType.GLOBAL
          if name is None and dim is None
          else DimType.VISIBLE
      )
      self.name = (
          name
          if name is not None
          else funsor.interpreter.gensym("PLATE")
      )
      self.size = size
      self.dim = dim
      if not hasattr(self, "_full_size"):
          self._full_size = size
      if indices is None:
          indices = funsor.ops.new_arange(
              funsor.tensor.get_default_prototype(), self.size
          )
      assert len(indices) == size
  
      self._indices = funsor.Tensor(
          indices,
          OrderedDict([(self.name, funsor.Bint[self.size])]),
          self._full_size,
      )
  
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 1 to create a new IndepMessenger object from inherited base classes: GlobalNamedMessenger with example: obj = IndepMessenger(name, size, dim, indices)