Skip to content
This repository was archived by the owner on Jan 21, 2025. It is now read-only.

Commit 2a30453

Browse files
author
Mesh TensorFlow Team
committed
Rolls back a change that broke several clients.
PiperOrigin-RevId: 371616165
1 parent fb55a77 commit 2a30453

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

mesh_tensorflow/tpu_variables.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@
2222
import contextlib
2323

2424
# pylint: disable=g-direct-tensorflow-import
25-
from tensorflow.python.compat import compat
2625
from tensorflow.python.framework import ops
2726
from tensorflow.python.ops import control_flow_ops
2827
from tensorflow.python.ops import gen_resource_variable_ops
2928

3029
try:
31-
from tensorflow.python.types import core # pylint:disable=g-import-not-at-top
30+
from tensorflow.python.types import core # pylint:disable=g-import-not-at-top,g-direct-tensorflow-import
3231
TF_23 = True
3332
except ImportError:
3433
TF_23 = False
@@ -82,11 +81,8 @@ def handle(self):
8281
tpu_context = _enclosing_tpu_context()
8382
if tpu_context is None:
8483
return self._primary_var.handle
85-
if compat.forward_compatible(2021, 4, 29):
86-
handles = [v.handle for v in self._vars]
87-
return tpu_context.get_replicated_var_handle(self._name, handles)
88-
else:
89-
return tpu_context.get_replicated_var_handle(self._name, self._vars)
84+
85+
return tpu_context.get_replicated_var_handle(self._name, self._vars)
9086

9187
@contextlib.contextmanager
9288
def _assign_dependencies(self):

0 commit comments

Comments
 (0)