Add _major_api_version setting to tensorflow top level module in pip package.

This attribute is checked in tensorflow/tools/api/tests:module_test and
tensorfow/tools/api/tests:api_compatibility_test.

PiperOrigin-RevId: 288046622
Change-Id: I9b8cf736a0395b9e90960567b0685db9b5307583
This commit is contained in:
Anna R 2020-01-03 14:07:29 -08:00 committed by TensorFlower Gardener
parent 572354c8fd
commit d6d4c5df84
2 changed files with 4 additions and 0 deletions

View File

@ -100,6 +100,8 @@ for _m in _top_level_modules:
# We still need all the names that are toplevel on tensorflow_core
from tensorflow_core import *
_major_api_version = 1
# In V1 API we need to print deprecation messages
from tensorflow.python.util import deprecation_wrapper as _deprecation
if not isinstance(_sys.modules[__name__], _deprecation.DeprecationWrapper):

View File

@ -100,6 +100,8 @@ for _m in _top_level_modules:
# We still need all the names that are toplevel on tensorflow_core
from tensorflow_core import *
_major_api_version = 2
# These should not be visible in the main tf module.
try:
del core