Only do dynamic padding when it's not a scalar for generic input.
Only do dynamic padding when it's not a scalar for generic input.

PiperOrigin-RevId: 256303758

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