Skip to content

Conversation

@Duyi-Wang
Copy link
Contributor

No description provided.

@tf_export(v1=["math.l2_normalize", "linalg.l2_normalize", "nn.l2_normalize"])
@deprecated_args(None, "dim is deprecated, use axis instead", "dim")
def l2_normalize(x, axis=None, epsilon=1e-12, name=None, dim=None):
def l2_normalize(x, axis=None, epsilon=1e-12, do_fusion=True, name=None, dim=None):
Copy link
Member

@liutongxuan liutongxuan Jul 1, 2022

Choose a reason for hiding this comment

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

我建议这里不要在中间位置加参数,这样导致用户不得不改代码。新参数加到dim后面

Copy link
Member

Choose a reason for hiding this comment

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

我建议这里还是不要改变原有l2_normalize的接口,我们既然新添了v2,就让v2默认打开fusion,并且保持v2有do_fusion这个可配置的参数

Copy link
Contributor Author

Choose a reason for hiding this comment

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

v1版本去掉do_fusion只能默认启用或关闭了,那v1在调用v2接口的时候是默认启用还是关闭?

Copy link
Member

Choose a reason for hiding this comment

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

v1的行为是关闭的。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

changqi1 and others added 16 commits July 11, 2022 16:54
  bazel test --action_env=TF_CPP_MIN_VLOG_LEVEL=1 --action_env=TF_CPP_MIN_LOG_LEVEL=0 --flaky_test_attempts 1 --test_output=all --nocache_test_results --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0 --copt=-march=skylake-avx512 -- //tensorflow/core/kernels:fused_l2_normalize_ops_test
bazel test --action_env=TF_CPP_MIN_VLOG_LEVEL=1 --action_env=TF_CPP_MIN_LOG_LEVEL=0 --flaky_test_attempts 1 --test_output=all --nocache_test_results --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0 --copt=-march=skylake-avx512 -- //tensorflow/python:nn_test
@Duyi-Wang Duyi-Wang force-pushed the features/fused_l2n branch from 1f08039 to dd05512 Compare July 11, 2022 08:58
@liutongxuan liutongxuan merged commit c7ba50c into DeepRec-AI:main Jul 13, 2022
@Duyi-Wang Duyi-Wang deleted the features/fused_l2n branch July 15, 2022 02:07
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.

4 participants