提交 b75d1009 编写于 作者: M Megvii Engine Team

fix(mge/elwise): removed back to fp32 mode

GitOrigin-RevId: 6d1720f4af7d93ccda2f8c73ebb99a1b25d0150a
上级 7c5d8401
...@@ -50,6 +50,7 @@ def _elwise(*args, mode): ...@@ -50,6 +50,7 @@ def _elwise(*args, mode):
if ( if (
mode mode
in ( in (
_ElwMod.TRUE_DIV,
_ElwMod.EXP, _ElwMod.EXP,
_ElwMod.POW, _ElwMod.POW,
_ElwMod.LOG, _ElwMod.LOG,
...@@ -66,7 +67,7 @@ def _elwise(*args, mode): ...@@ -66,7 +67,7 @@ def _elwise(*args, mode):
amp._enabled amp._enabled
or np.all([np.issubdtype(arg.dtype, np.integer) for arg in args]) or np.all([np.issubdtype(arg.dtype, np.integer) for arg in args])
) )
or mode in (_ElwMod.TRUE_DIV, _ElwMod.TANH,) or mode in (_ElwMod.TANH,)
and np.all([np.issubdtype(arg.dtype, np.integer) for arg in args]) and np.all([np.issubdtype(arg.dtype, np.integer) for arg in args])
): ):
# autocast to FP32 to maintain precision # autocast to FP32 to maintain precision
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册