Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export DTypePolicy as Policy for backward compat #470

Merged
merged 3 commits into from
Jul 13, 2023

Conversation

abheesht17
Copy link
Collaborator

@abheesht17 abheesht17 commented Jul 13, 2023

Resolves #468

@abheesht17
Copy link
Collaborator Author

Does @keras_core_export not work as expected? Had to add an extra statement in __init__.py. There are other such cases in the repo. For example,

@keras_core_export(
["keras_core.config.set_floatx", "keras_core.backend.set_floatx"]
)

>>> import keras_core as keras
Using TensorFlow backend
>>> keras.config.set_floatx
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'keras_core' has no attribute 'config'

@abheesht17 abheesht17 requested a review from fchollet July 13, 2023 17:29
@mattdangerw
Copy link
Member

mattdangerw commented Jul 13, 2023

Two reasons you might be seeing 'keras_core' has no attribute 'config'...

  1. you did a pip install . or pip install repo_url instead of using python pip_build.py --install
  2. you are running a script from the base of the keras-core repo, in which case the local directory keras_core will take precedence over the installed version (with all exported symbols).

@abheesht17
Copy link
Collaborator Author

Ah, yes. You are right. The second reason is why it's happening

Copy link
Contributor

@fchollet fchollet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@fchollet fchollet merged commit e4dec5a into keras-team:main Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export keras.mixed_precision.DTypePolicy as keras.mixed_precision.Policy
3 participants