docstr: Numpy implementation of `log_soo_sum`; readable but not efficient.
docstr_tok: ["Numpy","implementation","of","`","log_soo_sum","`",";","readable","but","not","efficient","."]
code: def _numpy_log_soomean_exp_impl(self, logx, axis):
      """Numpy implementation of `log_soo_sum`; readable but not efficient."""
      # Since this is a naive/intuitive implementation, we compensate by using the
      # highest precision we can.
      logx = np.float128(logx)
      n = logx.shape[0]
      u = np.exp(logx)
      loogeomean_u = []  # Leave-one-out geometric-average of exp(logx).
      for j in range(n):
          loogeomean_u.append(
              np.exp(
                  np.mean(
                      [logx[i, ...] for i in range(n) if i != j], axis=0
                  )
              )
          )
      loogeomean_u = np.array(loogeomean_u)
      loosum_x = []  # Leave-one-out sum of exp(logx).
      for j in range(n):
          loosum_x.append(
              np.sum([u[i, ...] for i in range(n) if i != j], axis=0)
          )
      loosum_x = np.array(loosum_x)
      # Natural log of the average u except each is swapped-out for its
      # leave-`i`-th-out Geometric average.
      log_soomean_u = np.log(loosum_x + loogeomean_u) - np.log(n)
      log_mean_u = np.log(np.mean(u, axis=0))
      return log_soomean_u, log_mean_u
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
  from tensorflow_probability.python.stats import leave_one_out
label_desc: Use image node_id 2 for calling the LogSooMeanTest obj's underlying member method code with example usage: obj._numpy_log_soomean_exp_impl(logx, axis) and returns: log_soomean_u,  log_mean_u