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

Added an option to use the pure python implementation. #1137

Merged
merged 17 commits into from
Mar 7, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Format.
  • Loading branch information
gabrieldemarmiesse committed Feb 25, 2020
commit 39ef6f8357387460a3ad428eceddaef1d9d9deb5
2 changes: 1 addition & 1 deletion tensorflow_addons/activations/hardshrink.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def hardshrink(
try:
return _hardshrink_custom_op(x, lower, upper)
except tf.errors.NotFoundError:
options.warn_fallback('hardshrink')
options.warn_fallback("hardshrink")

return _hardshrink_py(x, lower, upper)

Expand Down
3 changes: 1 addition & 2 deletions tensorflow_addons/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@


def warn_fallback(op_name):
warning_msg = FALLBACK_WARNING_TEMPLATE.format(traceback.format_exc(),
op_name)
warning_msg = FALLBACK_WARNING_TEMPLATE.format(traceback.format_exc(), op_name)
warnings.warn(warning_msg, RuntimeWarning)
global TF_ADDONS_PY_OPS
TF_ADDONS_PY_OPS = True