Skip to content

Commit

Permalink
Change legacy tf optimizers types to forwardrefs (#858)
Browse files Browse the repository at this point in the history
  • Loading branch information
ascillitoe authored Oct 6, 2023
1 parent ce24f3c commit 9dbeaf3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion alibi_detect/saving/_tensorflow/loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def load_kernel_config(cfg: dict) -> Callable:
return kernel


def load_optimizer(cfg: dict) -> Union[Type[tf.keras.optimizers.Optimizer], tf.keras.optimizers.Optimizer]:
def load_optimizer(cfg: dict) -> Union[Type['tf.keras.optimizers.Optimizer'], 'tf.keras.optimizers.Optimizer']:
"""
Loads a TensorFlow optimzier from a optimizer config dict.
Expand Down
2 changes: 1 addition & 1 deletion alibi_detect/saving/_tensorflow/saving.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def save_embedding_config(embed: TransformerEmbedding,
return cfg_embed


def save_optimizer_config(optimizer: Union[tf.keras.optimizers.Optimizer, tf.keras.optimizers.legacy.Optimizer]):
def save_optimizer_config(optimizer: Union['tf.keras.optimizers.Optimizer', 'tf.keras.optimizers.legacy.Optimizer']):
"""
Parameters
Expand Down

0 comments on commit 9dbeaf3

Please sign in to comment.