Remove control_dependencies that are no longer necessary
@@ -137,10 +137,6 @@ def client_computation(
num_examples += train_discriminator_fn(generator, discriminator, gen_inputs,
real_data)
- # TODO(b/142341957): This control_dependency should not be needed, but is
- # currently necessary to work around a TF bug with how tf.function handles
- # tf.data.Datasets.
- with tf.control_dependencies([num_examples]):
weights_delta = tf.nest.map_structure(tf.subtract, discriminator.weights,
from_server.discriminator_weights)
weights_delta, has_non_finite_delta = (
@@ -232,10 +228,6 @@ def server_computation(
gen_examples_this_round += train_generator_fn(generator, discriminator,
gen_inputs)
- # TODO(b/142341957): This control_dependency should not be needed, but is
- # currently necessary to work around a TF bug with how tf.function handles
- # tf.data.Datasets.
- with tf.control_dependencies([gen_examples_this_round]):
server_state.counters[
'num_generator_train_examples'] += gen_examples_this_round
server_state.generator_weights = _weights(generator)
