Commit 4680f2fa authored by Rick Chao's avatar Rick Chao Committed by A. Unique TensorFlower
Browse files

PSv2: Replace existing `tf.distribute.experimental.ParameterServerStrategy`...

PSv2: Replace existing `tf.distribute.experimental.ParameterServerStrategy` usage with `tf.compat.v1.distribute.experimental.ParameterServerStrategy` to prepare for the upcoming TF2 ParameterServerStrategy API release.

The practically only difference for API endpoint switch is the monitoring from V2 to V1, for those who were using `tf.distribute.experimental.ParameterServerStrategy`. It's not supported in V2 and should be tracked as V1 anyway.

PiperOrigin-RevId: 334847114
parent 2cad427b
......@@ -16,10 +16,6 @@
import json
import os
import random
import string
from absl import logging
import tensorflow as tf
......@@ -165,7 +161,7 @@ def get_distribution_strategy(distribution_strategy="mirrored",
cross_device_ops=_mirrored_cross_device_ops(all_reduce_alg, num_packs))
if distribution_strategy == "parameter_server":
return tf.distribute.experimental.ParameterServerStrategy()
return tf.compat.v1.distribute.experimental.ParameterServerStrategy()
raise ValueError("Unrecognized Distribution Strategy: %r" %
distribution_strategy)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment