fix assert in nan inf tests, test=develop (#21742)

paddle_tiny_install
WangXi 5 years ago committed by gongweibao
parent 8754cbd1f2
commit 4570295122

@ -107,10 +107,14 @@ if __name__ == '__main__':
assert False assert False
except Exception as e: except Exception as e:
print(e) print(e)
assert type(e) == core.EnforceNotMet print(type(e))
# Note. Enforce in cuda kernel may not catch in paddle, and
# Exception type will be RuntimeError
assert type(e) == core.EnforceNotMet or type(e) == RuntimeError
try: try:
check(use_cuda=False) check(use_cuda=False)
assert False assert False
except Exception as e: except Exception as e:
print(e) print(e)
print(type(e))
assert type(e) == core.EnforceNotMet assert type(e) == core.EnforceNotMet

Loading…
Cancel
Save