<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/probability/blob/v0.25.0/tensorflow_probability/python/distributions/log_prob_ratio.py#L38-L59) |

Computes `p.log_prob(x) - q.log_prob(y)`, numerically stably.

    tfp.experimental.distributions.log_prob_ratio(
        p, x, q, y, name=None, **kwargs
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `p` | A distribution instance. |
| `x` | A tensor from the support of `p`. |
| `q` | A distribution instance in the same family as `p`, with matching shape. |
| `y` | A tensor from the support of `q`. |
| `name` | Optional name for ops in this scope. |
| `**kwargs` | Passed to the distribution's `log_prob_ratio` implementation. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| `lp_ratio` | `log (p(x) / q(y)) = p.log_prob(x) - q.log_prob(y)`. In some cases this will be computed with better than naive numerical precision, e.g. by moving the difference inside of a sum reduction. |

<br />