未验证 提交 add62acf 编写于 作者: L Leo Chen 提交者: GitHub

remove kDepXOut for abs_grad op, test=develop (#21407)

上级 407f883f
...@@ -41,12 +41,6 @@ enum ActBwdOpFwdDeps { ...@@ -41,12 +41,6 @@ enum ActBwdOpFwdDeps {
kNoDeps = 0x00, // Do not need any forward input/output kNoDeps = 0x00, // Do not need any forward input/output
kDepX = 0x01, // Only need forward input X kDepX = 0x01, // Only need forward input X
kDepOut = 0x02, // Only need forward output Out kDepOut = 0x02, // Only need forward output Out
// Never add kDepXOut, because Out can be always calculated
// by forward input X in backward part.
// FIXME(zjl): but in MKLDNN abs, X and Out are all needed...
// Developers should not rely on this enum value!
kDepXOut = 0x03
}; };
/* The following operator can be used to process SelectedRows, because the /* The following operator can be used to process SelectedRows, because the
...@@ -769,7 +763,7 @@ struct AbsGradFunctor : public BaseActivationFunctor<T> { ...@@ -769,7 +763,7 @@ struct AbsGradFunctor : public BaseActivationFunctor<T> {
dx.device(d) = dout * x.sign(); dx.device(d) = dout * x.sign();
} }
static constexpr ActBwdOpFwdDeps FwdDeps() { return kDepXOut; } static constexpr ActBwdOpFwdDeps FwdDeps() { return kDepX; }
}; };
// reciprocal(x) = 1 / x // reciprocal(x) = 1 / x
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册