py_utils.py: Ensure static rank and shapes when possible in ExpandTo() and ExpandAndPadOrTrimTo().
py_utils.py: Ensure static rank and shapes when possible in ExpandTo() and ExpandAndPadOrTrimTo().

PiperOrigin-RevId: 409323000

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