From 08968c30dcf6907cb2a9b0d8f56d0358cac39edf Mon Sep 17 00:00:00 2001 From: Yifei Feng Date: Fri, 15 May 2020 12:41:50 -0700 Subject: [PATCH] Clarify why we have *-gpu package. Fix https://github.com/tensorflow/tensorflow/issues/39581 PiperOrigin-RevId: 311782903 Change-Id: If002f2d2b112012e1c75e0c16f7a922546a9bba5 --- tensorflow/tools/pip_package/setup.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tensorflow/tools/pip_package/setup.py b/tensorflow/tools/pip_package/setup.py index 4b8289a6202..8a5450d78b6 100644 --- a/tensorflow/tools/pip_package/setup.py +++ b/tensorflow/tools/pip_package/setup.py @@ -43,8 +43,6 @@ from setuptools import setup from setuptools.command.install import install as InstallCommandBase from setuptools.dist import Distribution -DOCLINES = __doc__.split('\n') - # This version string is semver compatible, but incompatible with pip. # For pip, we will remove all '-' characters from this string, and use the # result for pip. @@ -93,6 +91,16 @@ if 'tf_nightly' in project_name: elif 'tensorflow_estimator' in pkg: REQUIRED_PACKAGES[i] = 'tf-estimator-nightly' +DOCLINES = __doc__.split('\n') +if project_name.endswith('-gpu'): + project_name_no_gpu = project_name[:-len('-gpu')] + _GPU_PACKAGE_NOTE = 'Note that %s package by default supports both CPU and '\ + 'GPU. %s has the same content and exists solely for backward '\ + 'compatiblity. Please migrate to %s for GPU support.'\ + % (project_name_no_gpu, project_name, project_name_no_gpu) + DOCLINES.append(_GPU_PACKAGE_NOTE) + + # pylint: disable=line-too-long CONSOLE_SCRIPTS = [ 'toco_from_protos = tensorflow.lite.toco.python.toco_from_protos:main',