This repository was archived by the owner on Jan 21, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 2020from __future__ import print_function
2121
2222import contextlib
23+ import inspect
2324
2425# pylint: disable=g-direct-tensorflow-import
2526from tensorflow .python .framework import ops
@@ -82,9 +83,13 @@ def handle(self):
8283 if tpu_context is None :
8384 return self ._primary_var .handle
8485
85- # Using variable name as handle id.
86- return tpu_context .get_replicated_var_handle (self ._name , self ._name ,
87- self ._vars )
86+ # TODO(adarob): Remove backward-compatibility when TF 2.10 is released.
87+ if 'handle_id' not in inspect .signature (
88+ tpu_context .get_replicated_var_handle ).parameters :
89+ return tpu_context .get_replicated_var_handle (
90+ name = self ._name , vars_ = self ._vars )
91+ return tpu_context .get_replicated_var_handle (
92+ name = self ._name , handle_id = self ._name , vars_ = self ._vars )
8893
8994 @contextlib .contextmanager
9095 def _assign_dependencies (self ):
Original file line number Diff line number Diff line change 55
66setup (
77 name = 'mesh-tensorflow' ,
8- version = '0.1.20 ' ,
8+ version = '0.1.21 ' ,
99 description = 'Mesh TensorFlow' ,
1010 author = 'Google Inc.' ,
1111
You can’t perform that action at this time.
0 commit comments