mirror of https://github.com/commaai/tinygrad.git
hotfix: make openpilot test deterministic
This commit is contained in:
parent
9c306be282
commit
bfdce1f0e7
|
@ -90,6 +90,7 @@ def thneed_test_onnx(onnx_data, output_fn):
|
||||||
onnx_model = onnx.load(io.BytesIO(onnx_data))
|
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}
|
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()}
|
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()}
|
new_np_inputs = {k:v.realize().numpy() for k,v in inputs.items()}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue