Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
haraschax committed Dec 17, 2024
1 parent e051218 commit 2e16466
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions examples/openpilot/compile3.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ def compile(onnx_file):
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_types = {inp.name: tensor_dtype_to_np_dtype(inp.type.tensor_type.elem_type) for inp in onnx_model.graph.input}
if getenv("FLOAT16", 0) == 0: input_types = {k:(np.float32 if v==np.float16 else v) for k,v in input_types.items()}
input_types = {inp.name: np.float32 for inp in onnx_model.graph.input}
if 'input_img' in input_shapes:
input_types['input_img'] = np.uint8
else:
input_types['input_imgs'] = np.uint8
input_types['big_input_imgs'] = np.uint8
Tensor.manual_seed(100)
new_inputs = {k:Tensor.randn(*shp, dtype=_from_np_dtype(input_types[k])).mul(8).realize() for k,shp in sorted(input_shapes.items())}
new_inputs_numpy = {k:v.numpy() for k,v in new_inputs.items()}
Expand Down Expand Up @@ -89,7 +83,6 @@ def test_vs_compile(run, new_inputs, test_val=None):

# run 20 times
for _ in range(20):
inputs_numpy = {k:v.numpy() for k,v in new_inputs.items()}
st = time.perf_counter()
out = run(**inputs)
mt = time.perf_counter()
Expand Down

0 comments on commit 2e16466

Please sign in to comment.