From 880707f2d238a93acac6ed6134bdaea20ecfcd03 Mon Sep 17 00:00:00 2001 From: George Hotz Date: Mon, 29 Aug 2022 15:29:19 -0700 Subject: [PATCH] no torch test if no torch --- openpilot/compile.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/openpilot/compile.py b/openpilot/compile.py index b21c41248d..132219217c 100644 --- a/openpilot/compile.py +++ b/openpilot/compile.py @@ -169,10 +169,13 @@ def compile(input, output_fn): # float32 only FLOAT16 = int(os.getenv("FLOAT16", 0)) if FLOAT16 == 0: - from test.test_onnx import run_onnx_torch - torch_out = run_onnx_torch(onnx_model, np_inputs).numpy() - print(tinygrad_out_np, torch_out) - np.testing.assert_allclose(torch_out, tinygrad_out_np, atol=1e-4, rtol=1e-2) + try: + from test.test_onnx import run_onnx_torch + torch_out = run_onnx_torch(onnx_model, np_inputs).numpy() + print(tinygrad_out_np, torch_out) + np.testing.assert_allclose(torch_out, tinygrad_out_np, atol=1e-4, rtol=1e-2) + except ModuleNotFoundError: + pass # save local_cl_cache as thneed import struct, json