Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jan 21, 2025. It is now read-only.
/meshPublic archive

Commit6d44045

Browse files
adarobMesh TensorFlow Team
authored and
Mesh TensorFlow Team
committed
Make mesh_tensorflow's call ofget_replicated_var_handle backward-compatible with tf <= 2.8.0.Fixesgoogle-research/text-to-text-transfer-transformer#1020.
PiperOrigin-RevId: 448301001
1 parentb631ad5 commit6d44045

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

‎mesh_tensorflow/tpu_variables.py‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from __future__importprint_function
2121

2222
importcontextlib
23+
importinspect
2324

2425
# pylint: disable=g-direct-tensorflow-import
2526
fromtensorflow.python.frameworkimportops
@@ -82,9 +83,13 @@ def handle(self):
8283
iftpu_contextisNone:
8384
returnself._primary_var.handle
8485

85-
# Using variable name as handle id.
86-
returntpu_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'notininspect.signature(
88+
tpu_context.get_replicated_var_handle).parameters:
89+
returntpu_context.get_replicated_var_handle(
90+
name=self._name,vars_=self._vars)
91+
returntpu_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):

‎setup.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name='mesh-tensorflow',
8-
version='0.1.20',
8+
version='0.1.21',
99
description='Mesh TensorFlow',
1010
author='Google Inc.',
1111
author_email='no-reply@google.com',

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp