Skip to content

Commit 3bf1b5f

Browse files
ksachdevaseanpmorgan
authored andcommitted
FIX - Use public keras API for custom_object decorator (#97)
1 parent d2db251 commit 3bf1b5f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tensorflow_addons/utils/keras_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
# TODO: find public API alternative to these
2121
from tensorflow.python.keras.losses import LossFunctionWrapper # pylint: disable=unused-import
22-
from tensorflow.python.keras.utils import generic_utils
22+
from tensorflow.keras.utils import get_custom_objects
2323

2424

2525
def register_keras_custom_object(cls):
26-
generic_utils._GLOBAL_CUSTOM_OBJECTS[cls.__name__] = cls
26+
get_custom_objects()[cls.__name__] = cls
2727
return cls

0 commit comments

Comments
 (0)