mirror of
https://github.com/wassname/ray.git
synced 2026-07-24 13:20:22 +08:00
[tune] Fix default handling for timesteps (#3293)
This PR fixes an issue where previously if timesteps_this_iter = 0, then it would render as "None". Closes #3057.
This commit is contained in:
@@ -161,14 +161,14 @@ class Trainable(object):
|
||||
result.setdefault(DONE, False)
|
||||
|
||||
# self._timesteps_total should only be tracked if increments provided
|
||||
if result.get(TIMESTEPS_THIS_ITER):
|
||||
if result.get(TIMESTEPS_THIS_ITER) is not None:
|
||||
if self._timesteps_total is None:
|
||||
self._timesteps_total = 0
|
||||
self._timesteps_total += result[TIMESTEPS_THIS_ITER]
|
||||
self._timesteps_since_restore += result[TIMESTEPS_THIS_ITER]
|
||||
|
||||
# self._timesteps_total should only be tracked if increments provided
|
||||
if result.get(EPISODES_THIS_ITER):
|
||||
# self._episodes_total should only be tracked if increments provided
|
||||
if result.get(EPISODES_THIS_ITER) is not None:
|
||||
if self._episodes_total is None:
|
||||
self._episodes_total = 0
|
||||
self._episodes_total += result[EPISODES_THIS_ITER]
|
||||
|
||||
Reference in New Issue
Block a user