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