Explicitly assign keras and estimator as attributes.
This is required just to fix a strange side effect of our wrappers for lazy loading, deprecation messages, forwarding and virtual pip which causes failures in ``` console >>> import tensorflow as tf >>> tf.keras # tf.estimator has same error ``` We will need much more time to debug this, but this change seems to be a good way to patch this for now. PiperOrigin-RevId: 267431746
This commit is contained in:
parent
dd54d1fb70
commit
18c2cf989a
@ -129,4 +129,8 @@ try:
|
||||
del examples
|
||||
except NameError:
|
||||
pass
|
||||
|
||||
# Manually patch keras and estimator so tf.keras and tf.estimator work
|
||||
keras = _sys.modules["tensorflow.keras"]
|
||||
if not _root_estimator: estimator = _sys.modules["tensorflow.estimator"]
|
||||
# LINT.ThenChange(//tensorflow/virtual_root_template_v2.__init__.py.oss)
|
||||
|
@ -122,4 +122,8 @@ try:
|
||||
del examples
|
||||
except NameError:
|
||||
pass
|
||||
|
||||
# Manually patch keras and estimator so tf.keras and tf.estimator work
|
||||
keras = _sys.modules["tensorflow.keras"]
|
||||
if not _root_estimator: estimator = _sys.modules["tensorflow.estimator"]
|
||||
# LINT.ThenChange(//tensorflow/virtual_root_template_v1.__init__.py.oss)
|
||||
|
Loading…
Reference in New Issue
Block a user