View source on GitHub |
Periodically performs the tensorflow op in body
.
tf_agents.utils.common.periodically(
body, period, name='periodically'
)
The body tensorflow op will be executed every period
times the periodically
op is executed. More specifically, with n
the number of times the op has
been executed, the body will be executed when n
is a non zero positive
multiple of period
(i.e. there exist an integer k > 0
such that
k * period == n
).
If period
is None
, it will not perform any op and will return a
tf.no_op()
.
If period
is 1, it will just execute the body, and not create any counters
or conditionals.
Raises | |
---|---|
TypeError
|
if body is not a callable. |
Returns | |
---|---|
An op that periodically performs the specified op. |