Speed up nuts_test by wrapping the body of testLatentsOfMixedRank in tf.function.
Speed up nuts_test by wrapping the body of testLatentsOfMixedRank in tf.function.

That single test speeds up by a factor of 10, improving the overall
latency of the whole target by ~2x, and probably doing something
similar for the total work of the target (which is relevant as its
contribution to the latency of a large many-target test run).

We still test executing the sampler in Eager mode, on faster targets.

PiperOrigin-RevId: 284766002

tensorflow/probability,tensorflow/probability