class_docstr: Extension of IndepMessenger that includes subsampling.
class_docstr_tok: ["Extension","of","IndepMessenger","that","includes","subsampling","."]
code: def __init__(
      self,
      name: str,
      size: Optional[int] = None,
      subsample_size: Optional[int] = None,
      subsample: Optional[torch.Tensor] = None,
      dim: Optional[int] = None,
      use_cuda: Optional[bool] = None,
      device: Optional[str] = None,
  ) -> None:
      full_size, self.subsample_size, subsample = self._subsample(
          name,
          size,
          subsample_size,
          subsample,
          use_cuda,
          device,
      )
      super().__init__(name, full_size, dim, device)
      self._indices = subsample
  
file_path: pyro/pyro/poutine/subsample_messenger.py
imports: from typing import Optional, Tuple
  import torch
  from pyro.distributions.distribution import Distribution
  from pyro.poutine.indep_messenger import CondIndepStackFrame, IndepMessenger
  from pyro.poutine.runtime import Message, apply_stack
  from pyro.poutine.util import is_validation_enabled
  from pyro.util import ignore_jit_warnings
label_desc: Use image node_id 1 to create a new SubsampleMessenger object from inherited base classes: IndepMessenger with example: obj = SubsampleMessenger(name, size, subsample_size, subsample, dim, use_cuda, device)