Small fix to TensorShape usage to be forwards/backwards compatible with v1 and v2 TensorShape.
Small fix to TensorShape usage to be forwards/backwards compatible with v1 and v2 TensorShape.

In v2, when iterating, the shape returns int/None directly, whereas the v1 version returns a Dimension. as_list() works the same in both.

PiperOrigin-RevId: 255305913

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