ReduceSum

This commit is contained in:
George Hotz
2022-10-20 12:48:14 -07:00
parent c400ee0beb
commit ace8db29f8
2 changed files with 3 additions and 2 deletions

View File

@@ -81,6 +81,7 @@ def get_run_onnx(onnx_model):
elif n.op_type == "Squeeze": ret = inp[0].reshape([s for i,s in enumerate(inp[0].shape) if i not in opt['axes']])
elif n.op_type == "Unsqueeze": ret = inp[0].reshape(np.insert(inp[0].shape, opt['axes'][0], 1).tolist())
elif n.op_type == "ReduceL2": ret = inp[0].pow(2).sum(axis=opt['axes'], keepdim=opt['keepdims']).sqrt()
elif n.op_type == "ReduceSum": ret = inp[0].sum(axis=opt['axes'], keepdim=opt['keepdims'])
elif n.op_type == "GlobalAveragePool": ret = inp[0].mean(axis=tuple(range(2, len(inp[0].shape))), keepdim=True)
elif n.op_type == "Shape": ret = inp[0].shape
elif n.op_type == "Expand": ret = inp[0].reshape([1]*(max(len(inp[0].shape), len(inp[1]))-len(inp[0].shape)) + list(inp[0].shape)) # just broadcast

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
OPENCL=1 DEBUGCL=1 python3 openpilot/compile.py
#OPENCL=1 DEBUGCL=1 python3 openpilot/compile.py ../selfdrive/modeld/models/supercombo.onnx ../selfdrive/modeld/models/supercombo.thneed
#OPENCL=1 DEBUGCL=1 python3 openpilot/compile.py
OPENCL=1 DEBUGCL=1 python3 openpilot/compile.py ../selfdrive/modeld/models/supercombo.onnx ../selfdrive/modeld/models/supercombo.thneed
#FLOAT32=1 python3 openpilot/run_thneed.py $PWD/../selfdrive/modeld/models/supercombo.thneed $PWD/../selfdrive/modeld/models/supercombo.onnx