no torch test if no torch
@@ -169,10 +169,13 @@ def compile(input, output_fn):
# float32 only
FLOAT16 = int(os.getenv("FLOAT16", 0))
if FLOAT16 == 0:
+ 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
