Open
Conversation
为此我们优化了原版 model_norm 方法,增强了可读性且运行效率提高了一倍,若在 GPU 环境之中运行代码, 性能提升会更加明显。 Signed-off-by: volmodaoist <1304548501@qq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
对于张量运算应尽量避免使用循环,原版的 model_norm 函数 (i.e. 计算两个模型之间的欧式距离) 使用 for 实现,导致效率偏低且可读性差。为此我们优化了原版 model_norm 方法,增强了可读性且运行效率提高了一倍,若在 GPU 环境之中运行代码, 性能提升会更加显著。