mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-23 13:58:00 -05:00
no torch test if no torch
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user