Avoid using tf.ones() to generate mask as it is not supported by Cloud TPU when the shape is not static.
Avoid using tf.ones() to generate mask as it is not supported by Cloud TPU when
the shape is not static.

PiperOrigin-RevId: 396451309

google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research