Eric Kunze | 286f834 | 2022-06-22 11:30:23 -0700 | [diff] [blame^] | 1 | #!/bin/bash -x |
| 2 | set -e |
| 3 | |
| 4 | run_test() |
| 5 | { |
| 6 | TEST=$1; shift |
| 7 | FRAMEWORK=$1; shift |
| 8 | |
| 9 | echo "#### RUNNING EXAMPLE ${FRAMEWORK} ${TEST}" |
| 10 | |
| 11 | # Assumes the reference model is already built in ../build |
| 12 | |
| 13 | ../build/reference_model/tosa_reference_model \ |
| 14 | --test_desc=examples/${TEST}/flatbuffer-${FRAMEWORK}/desc.json \ |
| 15 | --ofm_file=out.npy |
| 16 | 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()));" \ |
| 17 | examples/${TEST}/${FRAMEWORK}_result.npy \ |
| 18 | examples/${TEST}/flatbuffer-${FRAMEWORK}/out.npy |
| 19 | } |
| 20 | |
| 21 | run_test test_add_1x4x4x4_f32 tf |
| 22 | run_test test_add_1x4x4x4_f32 tflite |
| 23 | run_test test_conv2d_1x1_1x32x32x8_f32_st11_padSAME_dilat11 tf |
| 24 | run_test test_conv2d_1x1_1x32x32x8_f32_st11_padSAME_dilat11 tflite |
| 25 | run_test test_conv2d_1x1_1x32x32x8_qi8_st11_padSAME_dilat11 tflite |