Skip to content

Commit

Permalink
fix import
Browse files Browse the repository at this point in the history
  • Loading branch information
chenmoneygithub committed Jun 19, 2022
1 parent 82554de commit 8e0439a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/testing/source_code_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

from typedapi import ensure_api_is_typed

import importlib
import tensorflow_addons as tfa
import tensorflow as tf

Expand All @@ -40,8 +41,10 @@ def test_api_typed():
# Files within this list will be exempt from verification.
exception_list = [
tfa.rnn.PeepholeLSTMCell,
tf.keras.optimizers.legacy.optimizer.Optimizer,
]
if importlib.util.find_spec("tensorflow.keras.optimizers.legacy") is not None:
exception_list.append(tf.keras.optimizers.legacy.optimizer.Optimizer)

help_message = (
"You can also take a look at the section about it in the CONTRIBUTING.md:\n"
"https://github.com/tensorflow/addons/blob/master/CONTRIBUTING.md#about-type-hints"
Expand Down

0 comments on commit 8e0439a

Please sign in to comment.