class_docstr: Enumerates in parallel over discrete sample sites marked
  ``infer={"enumerate": "parallel"}``.
  
  :param int first_available_dim: The first tensor dimension (counting
      from the right) that is available for parallel enumeration. This
      dimension and all dimensions left may be used internally by Pyro.
      This should be a negative integer or None.
class_docstr_tok: ["Enumerates","in","parallel","over","discrete","sample","sites","marked","``","infer=","{","``","enumerate","''",":","``","parallel","''","}","``",".",":","param","int","first_available_dim",":","The","first","tensor","dimension","(","counting","from","the","right",")","that","is","available","for","parallel","enumeration",".","This","dimension","and","all","dimensions","left","may","be","used","internally","by","Pyro",".","This","should","be","a","negative","integer","or","None","."]
code: def _pyro_post_sample(self, msg: Message) -> None:
      # Save all dims exposed in this sample value.
      # Whereas all of site["_dim_to_id"] are needed to interpret a
      # site's log_prob tensor, only a filtered subset self._value_dims[msg["name"]]
      # are needed to interpret a site's value.
      if not isinstance(msg["fn"], TorchDistributionMixin):
          return
      value = msg["value"]
      if value is None:
          return
  
      assert isinstance(msg["name"], str)
      assert msg["infer"] is not None
      shape = value.data.shape[: value.dim() - msg["fn"].event_dim]
      dim_to_id = msg["infer"].setdefault("_dim_to_id", {})
      dim_to_id.update(self._param_dims.get(msg["name"], {}))
      with ignore_jit_warnings():
          self._value_dims[msg["name"]] = {
              dim: id_
              for dim, id_ in dim_to_id.items()
              if len(shape) >= -dim and shape[dim] > 1
          }
  
file_path: pyro/pyro/poutine/enum_messenger.py
imports: from typing import Any, Dict, List, Optional
  import torch
  from typing_extensions import Self
  from pyro.distributions.torch import Categorical
  from pyro.distributions.torch_distribution import TorchDistributionMixin
  from pyro.ops.indexing import Vindex
  from pyro.poutine.messenger import Messenger
  from pyro.poutine.runtime import _ENUM_ALLOCATOR, Message
  from pyro.util import ignore_jit_warnings
label_desc: Use image node_id 4 for calling the EnumMessenger obj's underlying member method code with example usage: obj._pyro_post_sample(msg) without return types