class_docstr: Since tfd.Sample uses transposes, it requires a custom event bijector.
class_docstr_tok: ["Since","tfd.Sample","uses","transposes",",","it","requires","a","custom","event","bijector","."]
code: def __init__(self, distribution, sample_shape, sum_fn, bijector=None):
      parameters = dict(locals())
      self.distribution = distribution
      if bijector is None:
          bijector = (
              distribution.experimental_default_event_space_bijector()
          )
      self.bijector = bijector
      self.sample_shape = sample_shape
      self._sum_fn = sum_fn
      sample_ndims = ps.rank_from_shape(self.sample_shape)
      super(_NonCompositeTensorDefaultSampleBijector, self).__init__(
          forward_min_event_ndims=(
              self.bijector.forward_min_event_ndims + sample_ndims
          ),
          inverse_min_event_ndims=(
              self.bijector.inverse_min_event_ndims + sample_ndims
          ),
          parameters=parameters,
      )
  
imports: import functools
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector
  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 dtype_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.math import generic
label_desc: Use image node_id 1 to create a new _NonCompositeTensorDefaultSampleBijector object from inherited base classes: bijector_lib with example: obj = _NonCompositeTensorDefaultSampleBijector(distribution, sample_shape, sum_fn, bijector)