class_docstr: Event space bijector for Masked distributions.
class_docstr_tok: ["Event","space","bijector","for","Masked","distributions","."]
code: def _make_safe_x(self, x, validity_mask):
      bij = self._bijector
      masked = self._masked
      pullback_event_ndims = ps.rank_from_shape(
          lambda: bij.inverse_event_shape_tensor(
              masked.event_shape_tensor()
          ),
          self._bijector.inverse_event_shape(masked.event_shape),
      )
      pullback_event_mask = _add_event_dims_to_mask(
          validity_mask, event_ndims=pullback_event_ndims
      )
      # We presume that 0 in unconstrained space is safe.
      return tf.where(pullback_event_mask, x, 0.0)
  
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector
  from tensorflow_probability.python.distributions import batch_broadcast
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.distributions import log_prob_ratio
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import auto_composite_tensor
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import tensor_util
label_desc: Use image node_id 6 for calling the _NonCompositeTensorMaskedBijector obj's underlying member method code with example usage: obj._make_safe_x(x, validity_mask) and returns: tf