Skip to content

Commit

Permalink
give dm npy for now
Browse files Browse the repository at this point in the history
  • Loading branch information
haraschax committed Dec 7, 2024
1 parent 58f47a4 commit bfd980d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/openpilot/compile3.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def compile():
for i in range(3):
GlobalCounters.reset()
print(f"run {i}")
inputs = {**{k:v.clone() for k,v in new_inputs.items() if 'img' in k},
**{k:Tensor(v, device="NPY").realize() for k,v in new_inputs_numpy.items() if 'img' not in k}}
inputs = {**{k:v.clone() for k,v in new_inputs.items() if 'imgs' in k},
**{k:Tensor(v, device="NPY").realize() for k,v in new_inputs_numpy.items() if 'imgs' not in k}}
with Context(DEBUG=max(DEBUG.value, 2 if i == 2 else 1)):
ret = run_onnx_jit(**inputs).numpy()
# copy i == 1 so use of JITBEAM is okay
Expand Down Expand Up @@ -74,8 +74,8 @@ def test(test_val=None):
new_inputs_numpy = {k:v.numpy() for k,v in new_inputs.items()}

# create fake "from_blob" tensors for the inputs, and wrapped NPY tensors for the numpy inputs (these have the same underlying memory)
inputs = {**{k:v for k,v in new_inputs.items() if 'img' in k},
**{k:Tensor(v, device="NPY").realize() for k,v in new_inputs_numpy.items() if 'img' not in k}}
inputs = {**{k:v for k,v in new_inputs.items() if 'imgs' in k},
**{k:Tensor(v, device="NPY").realize() for k,v in new_inputs_numpy.items() if 'imgs' not in k}}

# run 20 times
for _ in range(20):
Expand Down

0 comments on commit bfd980d

Please sign in to comment.