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 22
22
import contextlib
23
23
24
24
# pylint: disable=g-direct-tensorflow-import
25
- from tensorflow .python .compat import compat
26
25
from tensorflow .python .framework import ops
27
26
from tensorflow .python .ops import control_flow_ops
28
27
from tensorflow .python .ops import gen_resource_variable_ops
29
28
30
29
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
32
31
TF_23 = True
33
32
except ImportError :
34
33
TF_23 = False
@@ -82,11 +81,8 @@ def handle(self):
82
81
tpu_context = _enclosing_tpu_context ()
83
82
if tpu_context is None :
84
83
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 )
90
86
91
87
@contextlib .contextmanager
92
88
def _assign_dependencies (self ):
You can’t perform that action at this time.
0 commit comments