From 8c0bab7f5e484d1ce5a82620904c2cbc09443cb2 Mon Sep 17 00:00:00 2001 From: Masaki Watanabe Date: Mon, 3 Apr 2023 17:14:54 +0900 Subject: [PATCH] abs --- export_static_onnx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/export_static_onnx.py b/export_static_onnx.py index 135a746..44df3b0 100644 --- a/export_static_onnx.py +++ b/export_static_onnx.py @@ -138,7 +138,7 @@ def prepare_data(args): energy_orig = float(atoms.get_potential_energy()) print("energy = ", energy, "eV") print("energy_orig = ", energy_orig, "eV") - assert abs(energy - energy_orig) < 1e-7 * energy_orig + assert abs(energy - energy_orig) < 1e-7 * abs(energy_orig) print("out_dir = ", out_dir, file=sys.stderr) ppe_onnx.export_testcase(exporter, tuple(args.values()), out_dir, verbose=True) \ No newline at end of file