Skip to content

Commit

Permalink
[Cherry-Pick]Move valid check from python to kernel (#46980)
Browse files Browse the repository at this point in the history
为了提升性能,将label的边界检查从python端转移到kernel内,减少额外op的调用,如min、max和同步拷贝等
    当前的模板参数IgnoreIndex仅在ignore_index取值范围在[0, dim)时才生效,但是当某个label值超出了边界,ignore_index等于该label,这种情况下是应该仍然能正常计算。虽然当前的计算逻辑在结果上不会出错,但逻辑上仍是有问题的,且模板参数IgnoreIndex是没有必要的
  • Loading branch information
ZzSean committed Oct 17, 2022
1 parent 5c2bea1 commit 8bfd45a
Show file tree
Hide file tree
Showing 2 changed files with 164 additions and 236 deletions.
Loading

0 comments on commit 8bfd45a

Please sign in to comment.