Apply gradient clipping before writing the histogram to avoid "Nan in summary histogram" errors which cause the controller to crash.
Apply gradient clipping before writing the histogram to avoid "Nan in summary histogram" errors which cause the controller to crash.

PiperOrigin-RevId: 219510307

tensorflow/lingvo,tensorflow/lingvo,tensorflow/lingvo,tensorflow/lingvo