class_docstr: Extension of IndepMessenger that includes subsampling.
class_docstr_tok: ["Extension","of","IndepMessenger","that","includes","subsampling","."]
code: def _process_message(self, msg: Message) -> None:
      frame = CondIndepStackFrame(
          name=self.name,
          dim=self.dim,
          size=self.subsample_size,
          counter=self.counter,
          full_size=self.size,  # used for param initialization
      )
      msg["cond_indep_stack"] = (frame,) + msg["cond_indep_stack"]
      if isinstance(self.size, torch.Tensor) or isinstance(  # type: ignore[unreachable]
          self.subsample_size, torch.Tensor  # type: ignore[unreachable]
      ):
          if not isinstance(msg["scale"], torch.Tensor):  # type: ignore[unreachable]
              with ignore_jit_warnings():
                  msg["scale"] = torch.tensor(msg["scale"])
      msg["scale"] = msg["scale"] * self.size / self.subsample_size
  
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 4 for calling the SubsampleMessenger obj's underlying member method code with example usage: obj._process_message(msg) without return types