From bfdce1f0e74f24a596909b9d8ae2ed96aaba5cc8 Mon Sep 17 00:00:00 2001 From: George Hotz Date: Fri, 1 Dec 2023 15:37:23 -0800 Subject: [PATCH] hotfix: make openpilot test deterministic --- openpilot/compile2.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openpilot/compile2.py b/openpilot/compile2.py index f5094eda..7f2a79cf 100644 --- a/openpilot/compile2.py +++ b/openpilot/compile2.py @@ -90,6 +90,7 @@ def thneed_test_onnx(onnx_data, output_fn): onnx_model = onnx.load(io.BytesIO(onnx_data)) input_shapes = {inp.name:tuple(x.dim_value for x in inp.type.tensor_type.shape.dim) for inp in onnx_model.graph.input} + Tensor.manual_seed(1337) inputs = {k:Tensor.randn(*shp, requires_grad=False)*8 for k,shp in input_shapes.items()} new_np_inputs = {k:v.realize().numpy() for k,v in inputs.items()}