Browse Source

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

GitOrigin-RevId: 6d1720f4af
tags/v1.7.2.m1
Megvii Engine Team 3 years ago
parent
commit
b75d10094d
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      imperative/python/megengine/core/tensor/array_method.py

+ 2
- 1
imperative/python/megengine/core/tensor/array_method.py View File

@@ -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):
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


Loading…
Cancel
Save