ONE - On-device Neural Engine
|
Data Structures | |
class | OnnxRunner |
Functions | |
to_numpy (tensor) | |
to_nhwc (tensor) | |
Variables | |
parser = argparse.ArgumentParser() | |
type | |
str | |
required | |
args = parser.parse_args() | |
driver = args.driver | |
onnx_filepath = args.onnx | |
circle_filepath = args.circle | |
onnx_runner = OnnxRunner(onnx_filepath) | |
process | |
int | rtolerance = 1e-03 |
int | atolerance = 1e-04 |
bool | result_compare = True |
output_shape = onnx_runner.outputs[idx].shape | |
output_type = onnx_runner.outputs[idx].type | |
output_np_type = np.float32 | |
output_data = np.fromfile(circle_filepath + ".output" + str(idx), output_np_type) | |
shape_file = open(circle_filepath + ".output" + str(idx) + ".shape", 'r') | |
luci_output_data = np.reshape(output_data, output_shape) | |
output_nchw = onnx_runner.outs[idx] | |
output_nhwc = to_nhwc(output_nchw) | |
diff = np.isclose(output_nhwc, luci_output_data, rtol=rtolerance, atol=atolerance) | |
result_compare_one = np.all(diff) | |
diff_val = np.subtract(output_nhwc, luci_output_data) | |
'export SCRIPT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" #
validate_onnx2circle.to_nhwc | ( | tensor | ) |
Definition at line 48 of file validate_onnx2circle.py.
Referenced by validate_onnx2circle.OnnxRunner.feed_random_inputs().
validate_onnx2circle.to_numpy | ( | tensor | ) |
Definition at line 44 of file validate_onnx2circle.py.
Referenced by validate_onnx2circle.OnnxRunner.feed_random_inputs().
validate_onnx2circle.args = parser.parse_args() |
Definition at line 37 of file validate_onnx2circle.py.
int validate_onnx2circle.atolerance = 1e-04 |
Definition at line 125 of file validate_onnx2circle.py.
validate_onnx2circle.circle_filepath = args.circle |
Definition at line 41 of file validate_onnx2circle.py.
validate_onnx2circle.diff = np.isclose(output_nhwc, luci_output_data, rtol=rtolerance, atol=atolerance) |
Definition at line 147 of file validate_onnx2circle.py.
validate_onnx2circle.diff_val = np.subtract(output_nhwc, luci_output_data) |
Definition at line 152 of file validate_onnx2circle.py.
validate_onnx2circle.driver = args.driver |
Definition at line 39 of file validate_onnx2circle.py.
validate_onnx2circle.luci_output_data = np.reshape(output_data, output_shape) |
Definition at line 140 of file validate_onnx2circle.py.
validate_onnx2circle.onnx_filepath = args.onnx |
Definition at line 40 of file validate_onnx2circle.py.
validate_onnx2circle.onnx_runner = OnnxRunner(onnx_filepath) |
Definition at line 109 of file validate_onnx2circle.py.
validate_onnx2circle.output_data = np.fromfile(circle_filepath + ".output" + str(idx), output_np_type) |
Definition at line 137 of file validate_onnx2circle.py.
validate_onnx2circle.output_nchw = onnx_runner.outs[idx] |
Definition at line 143 of file validate_onnx2circle.py.
validate_onnx2circle.output_nhwc = to_nhwc(output_nchw) |
Definition at line 144 of file validate_onnx2circle.py.
validate_onnx2circle.output_np_type = np.float32 |
Definition at line 131 of file validate_onnx2circle.py.
list validate_onnx2circle.output_shape = onnx_runner.outputs[idx].shape |
Definition at line 128 of file validate_onnx2circle.py.
validate_onnx2circle.output_type = onnx_runner.outputs[idx].type |
Definition at line 129 of file validate_onnx2circle.py.
validate_onnx2circle.parser = argparse.ArgumentParser() |
Definition at line 33 of file validate_onnx2circle.py.
validate_onnx2circle.process |
Definition at line 117 of file validate_onnx2circle.py.
validate_onnx2circle.required |
Definition at line 34 of file validate_onnx2circle.py.
bool validate_onnx2circle.result_compare = True |
Definition at line 126 of file validate_onnx2circle.py.
validate_onnx2circle.result_compare_one = np.all(diff) |
Definition at line 149 of file validate_onnx2circle.py.
int validate_onnx2circle.rtolerance = 1e-03 |
Definition at line 124 of file validate_onnx2circle.py.
validate_onnx2circle.shape_file = open(circle_filepath + ".output" + str(idx) + ".shape", 'r') |
Definition at line 138 of file validate_onnx2circle.py.
validate_onnx2circle.str |
Definition at line 34 of file validate_onnx2circle.py.
Referenced by validate_onnx2circle.OnnxRunner.feed_random_inputs().
validate_onnx2circle.type |
Definition at line 34 of file validate_onnx2circle.py.