This repository was archived by the owner on Jan 21, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change 2222import contextlib
2323
2424# pylint: disable=g-direct-tensorflow-import
25- from tensorflow .python .compat import compat
2625from tensorflow .python .framework import ops
2726from tensorflow .python .ops import control_flow_ops
2827from tensorflow .python .ops import gen_resource_variable_ops
2928
3029try :
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
3332except 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 ):
You can’t perform that action at this time.
0 commit comments