code: def _kl_divergence(self, other_locs, other_weights, kernel=None, delta=1e-2):
          
          if kernel is None:
              kernel = st.norm(loc=0, scale=1).pdf
  
          dist = rescaled_distance_mtx(self, other_locs) / delta
          K = kernel(dist)
  
          return -self.est_entropy() - (1 / delta) * np.sum(
              self.particle_weights *
              np.log(
                  np.sum(
                      other_weights * K,
                      axis=1 # Sum over the particles of ``other``.
                  )
              ),
              axis=0  # Sum over the particles of ``self``.
          )
docs: Finds the KL divergence between this and another particle
          distribution by using a kernel density estimator to smooth over the
          other distribution's particles.