Fix our issue with the explicit import in __init__ (#19890)

This commit is contained in:
Matt Watson 2024-06-20 13:43:41 -04:00 committed by GitHub
parent d20f4a73f4
commit 2f846b0cfe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

@ -148,9 +148,9 @@ def update_package_init(template_fname, dest_fname, api_module):
for line in template_file:
if "# DO NOT EDIT." in line:
dest_file.write(line)
# Import all symbols from `api/`.
# Import all public symbols from `api/` and `__version__`.
for symbol in api_module.__dict__.keys():
if symbol.startswith("__") and symbol != "__version__":
if symbol.startswith("_") and symbol != "__version__":
continue
dest_file.write(f"from keras.api import {symbol}\n")
# Skip the previous autogenerated block.

@ -20,7 +20,6 @@ from keras.api import Sequential
from keras.api import StatelessScope
from keras.api import Variable
from keras.api import __version__
from keras.api import _tf_keras
from keras.api import activations
from keras.api import applications
from keras.api import backend