import tensorflow as tf

    """
    Standardize log normal random variable x using mus and log_sigmas.
    """
    if inverse:
        scales = tf.math.exp(log_sigmas)
        log_x = tf.math.log(x)
        ldj = log_x
        log_y = log_x*scales + mus
        ldj += log_sigmas
        z = tf.math.exp(log_y)
        return z, ldj
    else:
        scales = tf.math.exp(-log_sigmas)
        log_x = tf.math.log(x)
        ldj = -log_x
        log_y = (log_x - mus)*scales
        ldj -= log_sigmas
        z = tf.math.exp(log_y)
