To complete the [answer](https://mathoverflow.net/a/120385) of Diverietti and the [comment](https://mathoverflow.net/questions/120372/when-does-operatornameautx-operatornamebirx-hold#comment309306_120374) of Roy Smith, here is a statement which might interest you: 

**Theorem** If $X$, $Y$ are varieties over a field $k$, assume $X$ is smooth and $Y$ proper containing no rational curves. Then any rational map $X\dashrightarrow Y$ is everywhere defined. 

You can find that statement in Debarre's book [Higher-Dimensional Algebraic Geometry](https://doi.org/10.1007/978-1-4757-5406-3), Corollary 1.44 p. 31.

In particular, if $X$ is smooth projective and contains no rational curves, then its automorphism group is equal to the group of its birational endomorphisms.