Also compare the initial values with the loop values when checking loops for the same nested substructure. Tests coming soon.

PiperOrigin-RevId: 290133666
Change-Id: Ie53a7c0a13919cb30675ef3d28887859589a5b16
This commit is contained in:
Dan Moldovan 2020-01-16 13:33:43 -08:00 committed by TensorFlower Gardener
parent f3daa69cbc
commit ef8379e48b

View File

@ -209,6 +209,7 @@ def _verify_tf_loop_vars(init_vars,
shape_invariants)
for name, init, entry, exit_, invariant in named_vars:
try:
nest.assert_same_structure(init, entry, expand_composites=True)
nest.assert_same_structure(entry, exit_, expand_composites=True)
except (ValueError, TypeError) as e:
raise TypeError('"{}" does not have the same nested structure after one'