aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorEric Kunze <eric.kunze@arm.com>2022-06-22 11:30:23 -0700
committerEric Kunze <eric.kunze@arm.com>2022-08-22 22:59:54 +0000
commit286f834ce60e4ebcaaf131cb7da97ebf79098fa0 (patch)
tree83baf6a241912f980a0b1b311726fb5f7c97ac1e /examples
parent3c59d5d2b4c20ec64daff76fd04a374c5a5055e0 (diff)
downloadreference_model-286f834ce60e4ebcaaf131cb7da97ebf79098fa0.tar.gz
Simplify the argument parsing and debug code
Change-Id: Ia681aa0eb1d42fa31a4658badb376f7b32b2e338 Signed-off-by: Eric Kunze <eric.kunze@arm.com>
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/run_ref_model_examples.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/examples/run_ref_model_examples.sh b/examples/run_ref_model_examples.sh
new file mode 100755
index 0000000..5762021
--- /dev/null
+++ b/examples/run_ref_model_examples.sh
@@ -0,0 +1,25 @@
+#!/bin/bash -x
+set -e
+
+run_test()
+{
+ TEST=$1; shift
+ FRAMEWORK=$1; shift
+
+ echo "#### RUNNING EXAMPLE ${FRAMEWORK} ${TEST}"
+
+ # Assumes the reference model is already built in ../build
+
+ ../build/reference_model/tosa_reference_model \
+ --test_desc=examples/${TEST}/flatbuffer-${FRAMEWORK}/desc.json \
+ --ofm_file=out.npy
+ python3 -c "import sys; import numpy as np; a = np.load(sys.argv[1]); b = np.load(sys.argv[2]); sys.exit(int((a != b).all()));" \
+ examples/${TEST}/${FRAMEWORK}_result.npy \
+ examples/${TEST}/flatbuffer-${FRAMEWORK}/out.npy
+}
+
+run_test test_add_1x4x4x4_f32 tf
+run_test test_add_1x4x4x4_f32 tflite
+run_test test_conv2d_1x1_1x32x32x8_f32_st11_padSAME_dilat11 tf
+run_test test_conv2d_1x1_1x32x32x8_f32_st11_padSAME_dilat11 tflite
+run_test test_conv2d_1x1_1x32x32x8_qi8_st11_padSAME_dilat11 tflite