You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When passing a TimeStep or Trajectory to tf.print, the output presents the objects incorrectly in that some field values get printed in the wrong places.
Note the incorrect values in the output of the above code.
This occurs because both TimeStep and Trajectory use pprint.pformat in their respective __repr__ method, which sorts by the dict keys when printing. However, tf.print still prints field values in the order of the namedtuple's _fields, which results in a mismatch of field names and the associated values.
The text was updated successfully, but these errors were encountered:
When passing a
TimeStep
orTrajectory
totf.print
, the output presents the objects incorrectly in that some field values get printed in the wrong places.The following code demonstrates this:
Note the incorrect values in the output of the above code.
This occurs because both
TimeStep
andTrajectory
usepprint.pformat
in their respective__repr__
method, which sorts by the dict keys when printing. However,tf.print
still prints field values in the order of the namedtuple's_fields
, which results in a mismatch of field names and the associated values.The text was updated successfully, but these errors were encountered: