class_docstr: Bijector that auto-batches over both its inputs *and* any pinned values.
class_docstr_tok: ["Bijector","that","auto-batches","over","both","its","inputs","*","and","*","any","pinned","values","."]
docstr: Returns a map from names of pinned values to their batch+event ndims.
docstr_tok: ["Returns","a","map","from","names","of","pinned","values","to","their","batch+event","ndims","."]
code: def _pins_core_ndims(self):
      """Returns a map from names of pinned values to their batch+event ndims."""
      if not hasattr(self, "__pins_core_ndims"):  # Cache on first run.
          pinned_event_shape = {}
          original_jd = self._jd.distribution
          for name, event_shape in zip(
              original_jd._flat_resolve_names(),
              # TODO(davmre): support dynamic rank through `event_shape_tensor`.
              original_jd._model_flatten(original_jd.event_shape),
          ):
              if name in self._jd.pins:
                  pinned_event_shape[name] = event_shape
  
          self.__pins_core_ndims = tf.nest.map_structure(
              lambda s: (
                  tensorshape_util.rank(self._jd.batch_shape)
                  + tensorshape_util.rank(  # pylint: disable=g-long-lambda
                      s
                  )
              ),
              pinned_event_shape,
          )
          if any(nd is None for nd in self.__pins_core_ndims.values()):
              # No inherent reason this can't support Tensor-valued event ranks, but
              # it's annoying, so let's punt for now.
              raise ValueError(
                  "Attempting to construct an autovectorized support bijector, but "
                  "the rank of the underlying model's events is not statically "
                  "available. Contact tfprobability@tensorflow.org if you need this "
                  "functionality."
              )
      return self.__pins_core_ndims
  
imports: import collections
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import joint_distribution
  from tensorflow_probability.python.internal import docstring_util
  from tensorflow_probability.python.internal import structural_tuple
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import vectorization_util
  from tensorflow.python.util import nest
label_desc: Use image node_id 2 for calling the _DefaultJointBijectorAutoBatchedWithPins obj's underlying member method code with example usage: obj._pins_core_ndims() and returns: self