code: def compute_nonparametric_kl_from_normalized_weights(
      normalized_weights: tf.Tensor,
  ) -> tf.Tensor:
      """Estimate the actualized KL between the non-parametric and target policies."""
  
      # Compute integrand.
      num_action_samples = tf.cast(
          normalized_weights.shape[0], tf.float32
      )
      integrand = tf.math.log(
          num_action_samples * normalized_weights + 1e-8
      )
  
      # Return the expectation with respect to the non-parametric policy.
      return tf.reduce_sum(normalized_weights * integrand, axis=0)
  
file_path: acme/acme/tf/losses/mpo.py
imports: from typing import Dict, Tuple, Union
  import sonnet
  import tensorflow
  import tensorflow_probability
label_desc: Use image node_id 2 for calling a global function with example usage: compute_nonparametric_kl_from_normalized_weights(normalized_weights) and returns: tf