code: def log_ess_from_log_weights(log_weights, particles_dim=0):
      """Computes log-ESS estimate from log-weights along axis=particles_dim."""
      with tf.name_scope("ess_from_log_weights"):
          log_weights = tf.math.log_softmax(
              log_weights, axis=particles_dim
          )
          return -tf.math.reduce_logsumexp(
              2 * log_weights, axis=particles_dim
          )
  
imports: import collections
  import tensorflow.compat.v2
  from tensorflow_probability.python.experimental.mcmc import weighted_resampling
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.mcmc import kernel
  from tensorflow_probability.python.mcmc.internal import util
label_desc: Use image node_id 2 for calling a global function with example usage: log_ess_from_log_weights(log_weights, particles_dim) and returns: unknown