oneflow icon indicating copy to clipboard operation
oneflow copied to clipboard

add nansum

Open marigoold opened this issue 3 years ago • 0 comments

概述:实现了 oneflow.nansum 算子 实现:

  • 和 reduce_sum 思路类似,但是增加了一个 binary_func: nansum
  • backward 和 reduce_sum 相同,都是 ones_like
  • 原来的 reduce 系列算子中,当某个需要 reduce 的 dim 上的 size 为 1 时,会自动进行 memcpy 操作。这里和 nansum 的结果冲突(因为要把 nan 转成 0),泽康实现了一个 primitive 的 unary func 用来处理 nan

注意事项:

  • 暂未支持 FP16

文档: image

marigoold avatar Sep 20 '22 04:09 marigoold