mirror of https://github.com/Jittor/Jittor
fix isnan check for int
This commit is contained in:
parent
fd5bd4aba9
commit
ef55bd378f
|
@ -9,7 +9,7 @@
|
|||
# file 'LICENSE.txt', which is part of this source code package.
|
||||
# ***************************************************************
|
||||
|
||||
__version__ = '1.3.5.35'
|
||||
__version__ = '1.3.5.36'
|
||||
from jittor_utils import lock
|
||||
with lock.lock_scope():
|
||||
ori_int = int
|
||||
|
|
|
@ -1967,15 +1967,15 @@ def _simple_for(x, func):
|
|||
'''
|
||||
return jt.code(x.shape, "bool", [x], cpu_src=src, cuda_src=src)
|
||||
|
||||
def isnan(x): return _simple_for(x, "isnan(x)")
|
||||
def isnan(x): return _simple_for(x, "isnan(float(x))")
|
||||
jt.Var.isnan = isnan
|
||||
def isfinite(x): return _simple_for(x, "!isnan(x) && !isinf(x)")
|
||||
def isfinite(x): return _simple_for(x, "!isnan(float(x)) && !isinf(float(x))")
|
||||
jt.Var.isfinite = isfinite
|
||||
def isinf(x): return _simple_for(x, "isinf(x)")
|
||||
def isinf(x): return _simple_for(x, "isinf(float(x))")
|
||||
jt.Var.isinf = isinf
|
||||
def isneginf(x): return _simple_for(x, "x<0 && isinf(x)")
|
||||
def isneginf(x): return _simple_for(x, "x<0 && isinf(float(x))")
|
||||
jt.Var.isneginf = isneginf
|
||||
def isposinf(x): return _simple_for(x, "x>0 && isinf(x)")
|
||||
def isposinf(x): return _simple_for(x, "x>0 && isinf(float(x))")
|
||||
jt.Var.isposinf = isposinf
|
||||
|
||||
# fake torch interface
|
||||
|
|
Loading…
Reference in New Issue