code: def _ildj_ratio_scale_matvec_diag(
      p, x, q, y, event_ndims, p_kwargs, q_kwargs
  ):
      del x, y, p_kwargs, q_kwargs
      return tf.math.reduce_sum(
          tf.math.log(tf.math.abs(q.scale.diag_part()))
          - tf.math.log(tf.math.abs(p.scale.diag_part())),
          axis=-1 - ps.range(event_ndims),
      )
  
file_path: probability/tensorflow_probability/python/bijectors/scale_matvec_diag.py
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import ldj_ratio
  from tensorflow_probability.python.bijectors import scale_matvec_linear_operator
  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
label_desc: Use image node_id 1 for calling a global function with example usage: _ildj_ratio_scale_matvec_diag(p, x, q, y, event_ndims, p_kwargs, q_kwargs) and returns: tf