"git@developer.sourcefind.cn:OpenDAS/torchaudio.git" did not exist on "beb6e530c782389314c37b1236e3c72b0ee0b64e"
Commit 096803bd 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 4ef1cbf3
...@@ -16,10 +16,6 @@ ...@@ -16,10 +16,6 @@
import json import json
import os import os
import random
import string
from absl import logging
import tensorflow as tf import tensorflow as tf
...@@ -165,7 +161,7 @@ def get_distribution_strategy(distribution_strategy="mirrored", ...@@ -165,7 +161,7 @@ def get_distribution_strategy(distribution_strategy="mirrored",
cross_device_ops=_mirrored_cross_device_ops(all_reduce_alg, num_packs)) cross_device_ops=_mirrored_cross_device_ops(all_reduce_alg, num_packs))
if distribution_strategy == "parameter_server": if distribution_strategy == "parameter_server":
return tf.distribute.experimental.ParameterServerStrategy() return tf.compat.v1.distribute.experimental.ParameterServerStrategy()
raise ValueError("Unrecognized Distribution Strategy: %r" % raise ValueError("Unrecognized Distribution Strategy: %r" %
distribution_strategy) 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