forked from cpetig/tflite_micro_compiler
-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (70 loc) · 2.15 KB
/
c-cpp.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: CI
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
config:
- {name: "Linux", os: ubuntu-latest, cmake-generator: ""}
- {name: "Windows", os: windows-latest, cmake-generator: "-G \"MinGW Makefiles\""}
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.name }}
steps:
- uses: actions/checkout@v2
- name: Requirements
shell: bash
run: |
cd ..
git clone https://github.com/tensorflow/tensorflow.git
cd tensorflow
git checkout origin/r2.3
make -f tensorflow/lite/micro/tools/make/Makefile hello_world
- name: Requirements (Windows)
if: matrix.config.os == 'windows-latest'
run: |
choco install wget unzip
- name: Configure
shell: bash
run: |
mkdir build
cd build
cmake ${{ matrix.config.cmake-generator }} ..
- name: Compile
shell: bash
run: |
cd build
cmake --build .
- name: Run
shell: bash
run: |
cd build
wget https://storage.googleapis.com/download.tensorflow.org/models/tflite/micro/hello_world_2020_04_13.zip
unzip hello_world_2020_04_13.zip
./compiler hello_world/models/model.tflite out.cpp
- name: Test setup
run: |
cd examples/generic_test
mkdir build
cd build
cmake ${{ matrix.config.cmake-generator }} ..
cmake --build .
# Binary representation of output -1.09 (~sin(1.5*PI))
echo "\xd6\xf3\x8b\xbf" > outExpect.txt
# Binary representation of input 4.71 (1.5*PI)
- name: Test setup (Windows)
if: matrix.config.os == 'windows-latest'
run: |
cd examples/generic_test/build
echo 52 b8 96 40 > inData.tmp
certutil -f -decodehex inData.tmp inData.bin
- name: Test setup (Linux)
if: matrix.config.os == 'ubuntu-latest'
run: |
cd examples/generic_test/build
echo -n -e '\x52\xb8\x96\x40' > inData.bin
- name: Test run
shell: bash
run: |
cd examples/generic_test/build
./generic_test inData.bin > outData.txt
cmp outData.txt outExpect.txt