tinymlc 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. tinymlc-0.1.0/.gitignore +241 -0
  2. tinymlc-0.1.0/.python-version +1 -0
  3. tinymlc-0.1.0/LICENSE +201 -0
  4. tinymlc-0.1.0/PKG-INFO +49 -0
  5. tinymlc-0.1.0/README.md +31 -0
  6. tinymlc-0.1.0/README_zh.md +30 -0
  7. tinymlc-0.1.0/TinyGUI/CMakeLists.txt +49 -0
  8. tinymlc-0.1.0/TinyGUI/resources/style.qss +0 -0
  9. tinymlc-0.1.0/TinyGUI/resources/tiny.icns +0 -0
  10. tinymlc-0.1.0/TinyGUI/src/ConfigDialog.cpp +215 -0
  11. tinymlc-0.1.0/TinyGUI/src/ConfigDialog.h +60 -0
  12. tinymlc-0.1.0/TinyGUI/src/ConfigPanel.cpp +189 -0
  13. tinymlc-0.1.0/TinyGUI/src/ConfigPanel.h +59 -0
  14. tinymlc-0.1.0/TinyGUI/src/ConsolePanel.cpp +69 -0
  15. tinymlc-0.1.0/TinyGUI/src/ConsolePanel.h +40 -0
  16. tinymlc-0.1.0/TinyGUI/src/GraphPanel.cpp +280 -0
  17. tinymlc-0.1.0/TinyGUI/src/GraphPanel.h +77 -0
  18. tinymlc-0.1.0/TinyGUI/src/MainWindow.cpp +696 -0
  19. tinymlc-0.1.0/TinyGUI/src/MainWindow.h +99 -0
  20. tinymlc-0.1.0/TinyGUI/src/main.cpp +29 -0
  21. tinymlc-0.1.0/TinyMLC/ANG/__init__.py +0 -0
  22. tinymlc-0.1.0/TinyMLC/ANG/args.py +86 -0
  23. tinymlc-0.1.0/TinyMLC/ANG/estimator.py +103 -0
  24. tinymlc-0.1.0/TinyMLC/ANG/estimator_hal.py +184 -0
  25. tinymlc-0.1.0/TinyMLC/ANG/estimator_qemu.py +257 -0
  26. tinymlc-0.1.0/TinyMLC/ANG/estimator_software.py +130 -0
  27. tinymlc-0.1.0/TinyMLC/ANG/model_builder.py +508 -0
  28. tinymlc-0.1.0/TinyMLC/ANG/model_generator.py +439 -0
  29. tinymlc-0.1.0/TinyMLC/ANG/model_info.py +283 -0
  30. tinymlc-0.1.0/TinyMLC/ANG/utils.py +420 -0
  31. tinymlc-0.1.0/TinyMLC/__init__.py +0 -0
  32. tinymlc-0.1.0/TinyMLC/cli.py +126 -0
  33. tinymlc-0.1.0/TinyMLC/codegen.py +877 -0
  34. tinymlc-0.1.0/TinyMLC/converter/__init__.py +0 -0
  35. tinymlc-0.1.0/TinyMLC/converter/export_weights.py +382 -0
  36. tinymlc-0.1.0/TinyMLC/converter/parser_litert.py +757 -0
  37. tinymlc-0.1.0/TinyMLC/converter/parser_onnx.py +649 -0
  38. tinymlc-0.1.0/TinyMLC/generate_lut.py +97 -0
  39. tinymlc-0.1.0/TinyMLC/handlers.py +325 -0
  40. tinymlc-0.1.0/TinyMLC/ops.py +76 -0
  41. tinymlc-0.1.0/TinyMLC/templates/lut.c.tpl +23 -0
  42. tinymlc-0.1.0/TinyMLC/templates/lut.h.tpl +67 -0
  43. tinymlc-0.1.0/TinyMLC/templates/model.c.tpl +314 -0
  44. tinymlc-0.1.0/TinyMLC/templates/model.h.tpl +66 -0
  45. tinymlc-0.1.0/TinyMLC/transform/__init__.py +0 -0
  46. tinymlc-0.1.0/TinyMLC/transform/algebraic.py +286 -0
  47. tinymlc-0.1.0/TinyMLC/transform/base.py +58 -0
  48. tinymlc-0.1.0/TinyMLC/transform/constant_folding.py +260 -0
  49. tinymlc-0.1.0/TinyMLC/transform/cse.py +192 -0
  50. tinymlc-0.1.0/TinyMLC/transform/dce.py +182 -0
  51. tinymlc-0.1.0/TinyMLC/transform/fusion.py +723 -0
  52. tinymlc-0.1.0/TinyMLC/transform/memory.py +200 -0
  53. tinymlc-0.1.0/TinyMLC/transform/pass_manager.py +101 -0
  54. tinymlc-0.1.0/TinyMLC/transform/simplify.py +515 -0
  55. tinymlc-0.1.0/docs/dev_en.md +64 -0
  56. tinymlc-0.1.0/docs/dev_zh.md +63 -0
  57. tinymlc-0.1.0/docs/guide_en.md +41 -0
  58. tinymlc-0.1.0/docs/guide_zh.md +41 -0
  59. tinymlc-0.1.0/docs/operators_en.md +61 -0
  60. tinymlc-0.1.0/docs/ops_zh.md +60 -0
  61. tinymlc-0.1.0/docs/porting_en.md +40 -0
  62. tinymlc-0.1.0/docs/porting_zh.md +40 -0
  63. tinymlc-0.1.0/main.py +30 -0
  64. tinymlc-0.1.0/ops/arm/build_arm_cmsis_nn_debug.sh.tpl +109 -0
  65. tinymlc-0.1.0/ops/arm/build_arm_cmsis_nn_release.sh.tpl +91 -0
  66. tinymlc-0.1.0/ops/arm/build_arm_pure_c_debug.sh +94 -0
  67. tinymlc-0.1.0/ops/arm/build_arm_pure_c_release.sh +100 -0
  68. tinymlc-0.1.0/ops/arm/cmsis_nn/add.c +48 -0
  69. tinymlc-0.1.0/ops/arm/cmsis_nn/avg_pool2d.c +60 -0
  70. tinymlc-0.1.0/ops/arm/cmsis_nn/conv2d.c +79 -0
  71. tinymlc-0.1.0/ops/arm/cmsis_nn/depthwise_conv2d.c +83 -0
  72. tinymlc-0.1.0/ops/arm/cmsis_nn/fc.c +74 -0
  73. tinymlc-0.1.0/ops/arm/cmsis_nn/global_avg_pool.c +74 -0
  74. tinymlc-0.1.0/ops/arm/cmsis_nn/max_pool2d.c +60 -0
  75. tinymlc-0.1.0/ops/arm/cmsis_nn/multiply.c +44 -0
  76. tinymlc-0.1.0/ops/arm/cmsis_nn/relu.c +55 -0
  77. tinymlc-0.1.0/ops/arm/cmsis_nn/relu6.c +60 -0
  78. tinymlc-0.1.0/ops/arm/cmsis_nn/softmax.c +48 -0
  79. tinymlc-0.1.0/ops/arm/debug_print.c +98 -0
  80. tinymlc-0.1.0/ops/arm/link_arm.ld +51 -0
  81. tinymlc-0.1.0/ops/arm/main_test.c +74 -0
  82. tinymlc-0.1.0/ops/arm/start.S +60 -0
  83. tinymlc-0.1.0/ops/c/add.c +29 -0
  84. tinymlc-0.1.0/ops/c/argmax.c +58 -0
  85. tinymlc-0.1.0/ops/c/avg_pool2d.c +52 -0
  86. tinymlc-0.1.0/ops/c/clip.c +42 -0
  87. tinymlc-0.1.0/ops/c/concat.c +33 -0
  88. tinymlc-0.1.0/ops/c/conv2d.c +92 -0
  89. tinymlc-0.1.0/ops/c/conv_transpose.c +87 -0
  90. tinymlc-0.1.0/ops/c/depthwise_conv2d.c +79 -0
  91. tinymlc-0.1.0/ops/c/fc.c +62 -0
  92. tinymlc-0.1.0/ops/c/flatten.c +32 -0
  93. tinymlc-0.1.0/ops/c/global_avg_pool.c +54 -0
  94. tinymlc-0.1.0/ops/c/hard_sigmoid.c +62 -0
  95. tinymlc-0.1.0/ops/c/leaky_relu.c +46 -0
  96. tinymlc-0.1.0/ops/c/lstm.c +202 -0
  97. tinymlc-0.1.0/ops/c/max_pool2d.c +51 -0
  98. tinymlc-0.1.0/ops/c/mean.c +72 -0
  99. tinymlc-0.1.0/ops/c/multiply.c +29 -0
  100. tinymlc-0.1.0/ops/c/nms.c +97 -0
  101. tinymlc-0.1.0/ops/c/pad.c +69 -0
  102. tinymlc-0.1.0/ops/c/prelu.c +50 -0
  103. tinymlc-0.1.0/ops/c/reduce_sum.c +65 -0
  104. tinymlc-0.1.0/ops/c/relu.c +26 -0
  105. tinymlc-0.1.0/ops/c/relu6.c +51 -0
  106. tinymlc-0.1.0/ops/c/reshape.c +35 -0
  107. tinymlc-0.1.0/ops/c/sigmoid.c +67 -0
  108. tinymlc-0.1.0/ops/c/softmax.c +41 -0
  109. tinymlc-0.1.0/ops/c/split.c +55 -0
  110. tinymlc-0.1.0/ops/c/strided_slice.c +47 -0
  111. tinymlc-0.1.0/ops/c/sub.c +30 -0
  112. tinymlc-0.1.0/ops/c/svdf.c +55 -0
  113. tinymlc-0.1.0/ops/c/tanh.c +66 -0
  114. tinymlc-0.1.0/ops/c/transpose.c +165 -0
  115. tinymlc-0.1.0/ops/c/upsample.c +48 -0
  116. tinymlc-0.1.0/ops/host/build_host_debug.sh +96 -0
  117. tinymlc-0.1.0/ops/host/debug_print.c +52 -0
  118. tinymlc-0.1.0/ops/host/main_test.c +61 -0
  119. tinymlc-0.1.0/ops/include/debug_print.h +66 -0
  120. tinymlc-0.1.0/ops/include/tinymlc.h +225 -0
  121. tinymlc-0.1.0/ops/riscv/build_riscv_nmsis_nn_debug.sh.tpl +107 -0
  122. tinymlc-0.1.0/ops/riscv/build_riscv_nmsis_nn_release.sh.tpl +88 -0
  123. tinymlc-0.1.0/ops/riscv/build_riscv_pure_c_debug.sh +104 -0
  124. tinymlc-0.1.0/ops/riscv/build_riscv_pure_c_release.sh +103 -0
  125. tinymlc-0.1.0/ops/riscv/debug_print.c +71 -0
  126. tinymlc-0.1.0/ops/riscv/link_riscv.ld +41 -0
  127. tinymlc-0.1.0/ops/riscv/main_test.c +61 -0
  128. tinymlc-0.1.0/ops/riscv/nmsis_nn/add.c +48 -0
  129. tinymlc-0.1.0/ops/riscv/nmsis_nn/avg_pool2d.c +60 -0
  130. tinymlc-0.1.0/ops/riscv/nmsis_nn/conv2d.c +79 -0
  131. tinymlc-0.1.0/ops/riscv/nmsis_nn/depthwise_conv2d.c +83 -0
  132. tinymlc-0.1.0/ops/riscv/nmsis_nn/fc.c +71 -0
  133. tinymlc-0.1.0/ops/riscv/nmsis_nn/global_avg_pool.c +73 -0
  134. tinymlc-0.1.0/ops/riscv/nmsis_nn/max_pool2d.c +60 -0
  135. tinymlc-0.1.0/ops/riscv/nmsis_nn/multiply.c +44 -0
  136. tinymlc-0.1.0/ops/riscv/nmsis_nn/relu.c +49 -0
  137. tinymlc-0.1.0/ops/riscv/nmsis_nn/relu6.c +60 -0
  138. tinymlc-0.1.0/ops/riscv/nmsis_nn/softmax.c +49 -0
  139. tinymlc-0.1.0/ops/riscv/start.S +25 -0
  140. tinymlc-0.1.0/pyproject.toml +44 -0
  141. tinymlc-0.1.0/tests/__init__.py +0 -0
  142. tinymlc-0.1.0/tests/test_extract_litert_weights.py +102 -0
  143. tinymlc-0.1.0/tests/test_generate_lut.py +80 -0
  144. tinymlc-0.1.0/tests/test_operators.py +226 -0
  145. tinymlc-0.1.0/tests/test_parser.py +98 -0
  146. tinymlc-0.1.0/tests/test_tflite_models.py +181 -0
  147. tinymlc-0.1.0/tests/test_translator.py +114 -0
  148. tinymlc-0.1.0/utils/__init__.py +0 -0
  149. tinymlc-0.1.0/utils/arm-none-eabi-gcc.cmake +53 -0
  150. tinymlc-0.1.0/utils/dump.py +86 -0
  151. tinymlc-0.1.0/utils/generate_onnx_models.py +183 -0
  152. tinymlc-0.1.0/utils/generate_tflite_models.py +236 -0
  153. tinymlc-0.1.0/utils/pack_macos.sh +88 -0
  154. tinymlc-0.1.0/utils/path.py +31 -0
  155. tinymlc-0.1.0/utils/riscv-none-elf-gcc.cmake +50 -0
  156. tinymlc-0.1.0/uv.lock +1657 -0
@@ -0,0 +1,241 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+ *.pyc
6
+
7
+ # C extensions
8
+ *.so
9
+ *.o
10
+ *.elf
11
+ *.bin
12
+ *.out
13
+
14
+ # Distribution / packaging
15
+ .Python
16
+ build/
17
+ develop-eggs/
18
+ dist/
19
+ downloads/
20
+ eggs/
21
+ .eggs/
22
+ lib/
23
+ lib64/
24
+ parts/
25
+ sdist/
26
+ var/
27
+ wheels/
28
+ share/python-wheels/
29
+ *.egg-info/
30
+ .installed.cfg
31
+ *.egg
32
+ MANIFEST
33
+
34
+ # PyInstaller
35
+ # Usually these files are written by a python script from a template
36
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
37
+ *.manifest
38
+ *.spec
39
+
40
+ # Installer logs
41
+ pip-log.txt
42
+ pip-delete-this-directory.txt
43
+
44
+ # Unit test / coverage reports
45
+ htmlcov/
46
+ .tox/
47
+ .nox/
48
+ .coverage
49
+ .coverage.*
50
+ .cache
51
+ nosetests.xml
52
+ coverage.xml
53
+ *.cover
54
+ *.py.cover
55
+ .hypothesis/
56
+ .pytest_cache/
57
+ cover/
58
+
59
+ # Translations
60
+ *.mo
61
+ *.pot
62
+
63
+ # Django stuff:
64
+ *.log
65
+ local_settings.py
66
+ db.sqlite3
67
+ db.sqlite3-journal
68
+
69
+ # Flask stuff:
70
+ instance/
71
+ .webassets-cache
72
+
73
+ # Scrapy stuff:
74
+ .scrapy
75
+
76
+ # Sphinx documentation
77
+ docs/_build/
78
+
79
+ # PyBuilder
80
+ .pybuilder/
81
+ target/
82
+
83
+ # Jupyter Notebook
84
+ .ipynb_checkpoints
85
+
86
+ # IPython
87
+ profile_default/
88
+ ipython_config.py
89
+
90
+ # pyenv
91
+ # For a library or package, you might want to ignore these files since the code is
92
+ # intended to run in multiple environments; otherwise, check them in:
93
+ # .python-version
94
+
95
+ # pipenv
96
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
97
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
98
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
99
+ # install all needed dependencies.
100
+ # Pipfile.lock
101
+
102
+ # UV
103
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
104
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
105
+ # commonly ignored for libraries.
106
+ # uv.lock
107
+
108
+ # poetry
109
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
110
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
111
+ # commonly ignored for libraries.
112
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
113
+ # poetry.lock
114
+ # poetry.toml
115
+
116
+ # pdm
117
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
118
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
119
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
120
+ # pdm.lock
121
+ # pdm.toml
122
+ .pdm-python
123
+ .pdm-build/
124
+
125
+ # pixi
126
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
127
+ # pixi.lock
128
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
129
+ # in the .venv directory. It is recommended not to include this directory in version control.
130
+ .pixi
131
+
132
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
133
+ __pypackages__/
134
+
135
+ # Celery stuff
136
+ celerybeat-schedule
137
+ celerybeat.pid
138
+
139
+ # Redis
140
+ *.rdb
141
+ *.aof
142
+ *.pid
143
+
144
+ # RabbitMQ
145
+ mnesia/
146
+ rabbitmq/
147
+ rabbitmq-data/
148
+
149
+ # ActiveMQ
150
+ activemq-data/
151
+
152
+ # SageMath parsed files
153
+ *.sage.py
154
+
155
+ # Environments
156
+ .env
157
+ .envrc
158
+ .venv
159
+ env/
160
+ venv/
161
+ ENV/
162
+ env.bak/
163
+ venv.bak/
164
+
165
+ # Spyder project settings
166
+ .spyderproject
167
+ .spyproject
168
+
169
+ # Rope project settings
170
+ .ropeproject
171
+
172
+ # mkdocs documentation
173
+ /site
174
+
175
+ # mypy
176
+ .mypy_cache/
177
+ .dmypy.json
178
+ dmypy.json
179
+
180
+ # Pyre type checker
181
+ .pyre/
182
+
183
+ # pytype static type analyzer
184
+ .pytype/
185
+
186
+ # Cython debug symbols
187
+ cython_debug/
188
+
189
+ # PyCharm
190
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
191
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
192
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
193
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
194
+ .idea/
195
+
196
+ # Abstra
197
+ # Abstra is an AI-powered process automation framework.
198
+ # Ignore directories containing user credentials, local state, and settings.
199
+ # Learn more at https://abstra.io/docs
200
+ .abstra/
201
+
202
+ # Visual Studio Code
203
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
204
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
205
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
206
+ # you could uncomment the following to ignore the entire vscode folder
207
+ .vscode/
208
+ # Temporary file for partial code execution
209
+ tempCodeRunnerFile.py
210
+
211
+ # Ruff stuff:
212
+ .ruff_cache/
213
+
214
+ # PyPI configuration file
215
+ .pypirc
216
+
217
+ # Marimo
218
+ marimo/_static/
219
+ marimo/_lsp/
220
+ __marimo__/
221
+
222
+ # Streamlit
223
+ .streamlit/secrets.toml
224
+
225
+ # Third-party dependencies (local only)
226
+ third_party/
227
+
228
+ # Model files
229
+ *.tflite
230
+
231
+ # Generated files
232
+ tinymlc_generated
233
+
234
+ # Test models (local only)
235
+ model_tests/
236
+
237
+ # Test output directories (local only)
238
+ test_*_output/
239
+
240
+ # TODO file (local only)
241
+ TODO.md
@@ -0,0 +1 @@
1
+ 3.13
tinymlc-0.1.0/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
tinymlc-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,49 @@
1
+ Metadata-Version: 2.4
2
+ Name: tinymlc
3
+ Version: 0.1.0
4
+ Summary: TinyML Compiler - Tiny Machine Learning Compiler
5
+ Author-email: Jia Liu <proljc@gmail.com>
6
+ License: Apache-2.0
7
+ License-File: LICENSE
8
+ Requires-Python: >=3.13
9
+ Requires-Dist: ai-edge-litert>=2.1.5
10
+ Requires-Dist: jinja2>=3.1.6
11
+ Requires-Dist: numpy>=2.4.6
12
+ Requires-Dist: onnx>=1.22.0
13
+ Requires-Dist: onnxruntime>=1.27.0
14
+ Requires-Dist: tensorflow>=2.21.0
15
+ Requires-Dist: termcolor>=3.3.0
16
+ Requires-Dist: torch>=2.12.1
17
+ Description-Content-Type: text/markdown
18
+
19
+ TinyMLC - Tiny Machine Learning Compiler
20
+
21
+ Automatic generation + optimization + deployment of MCU neural
22
+ networks.
23
+
24
+ Features
25
+
26
+ - Automatic network generation (ANG)
27
+ - ONNX / TFLite model conversion
28
+ - 7 optimization passes (constant folding, DCE, CSE, Simplify,
29
+ fusion, algebraic simplify, memory reuse)
30
+ - 31 pure-C operators (int8 quantization)
31
+ - Multi-backend support (Host / ARM / RISC-V)
32
+ - Qt6 GUI
33
+ - Accelerator library support (CMSIS-NN / NMSIS)
34
+
35
+ Quick Start
36
+
37
+ pip install -e .
38
+ python main.py generate --task-type classification --max-macs 100000
39
+ cd TinyGUI/build && ./TinyGUI
40
+
41
+ Documentation
42
+
43
+ User guide: docs/guide_en.txt
44
+ Porting: docs/porting_en.txt
45
+ Operator status: docs/ops_en.txt
46
+
47
+ License
48
+
49
+ Apache License 2.0
@@ -0,0 +1,31 @@
1
+ TinyMLC - Tiny Machine Learning Compiler
2
+
3
+ Automatic generation + optimization + deployment of MCU neural
4
+ networks.
5
+
6
+ Features
7
+
8
+ - Automatic network generation (ANG)
9
+ - ONNX / TFLite model conversion
10
+ - 7 optimization passes (constant folding, DCE, CSE, Simplify,
11
+ fusion, algebraic simplify, memory reuse)
12
+ - 31 pure-C operators (int8 quantization)
13
+ - Multi-backend support (Host / ARM / RISC-V)
14
+ - Qt6 GUI
15
+ - Accelerator library support (CMSIS-NN / NMSIS)
16
+
17
+ Quick Start
18
+
19
+ pip install -e .
20
+ python main.py generate --task-type classification --max-macs 100000
21
+ cd TinyGUI/build && ./TinyGUI
22
+
23
+ Documentation
24
+
25
+ User guide: docs/guide_en.txt
26
+ Porting: docs/porting_en.txt
27
+ Operator status: docs/ops_en.txt
28
+
29
+ License
30
+
31
+ Apache License 2.0
@@ -0,0 +1,30 @@
1
+ TinyMLC - 微型机器学习编译器
2
+
3
+ 自动生成 + 优化 + 部署 MCU 神经网络。
4
+
5
+ 特性
6
+
7
+ - 自动网络生成(ANG)
8
+ - ONNX / TFLite 模型转换
9
+ - 7 个优化 Pass(常量折叠、DCE、CSE、Simplify、
10
+ 融合、代数化简、内存复用)
11
+ - 31 个纯 C 算子(int8 量化)
12
+ - 多后端支持(Host / ARM / RISC-V)
13
+ - Qt6 图形界面
14
+ - 加速库支持(CMSIS-NN / NMSIS)
15
+
16
+ 快速开始
17
+
18
+ pip install -e .
19
+ python main.py generate --task-type classification --max-macs 100000
20
+ cd TinyGUI/build && ./TinyGUI
21
+
22
+ 文档
23
+
24
+ 用户指南: docs/guide_zh.txt
25
+ 移植指南: docs/porting_zh.txt
26
+ 算子状态: docs/ops_zh.txt
27
+
28
+ 许可证
29
+
30
+ Apache License 2.0
@@ -0,0 +1,49 @@
1
+ # -*- coding: utf-8 -*-
2
+ # TinyMLC - Tiny Machine Learning Compiler
3
+ #
4
+ # Copyright (c) 2026 Jia Liu & TinyMLC Contributors
5
+ # SPDX-License-Identifier: Apache-2.0
6
+ #
7
+ # This file is part of TinyMLC.
8
+ # Licensed under the Apache License, Version 2.0 (the "License");
9
+ # you may not use this file except in compliance with the License.
10
+ # You may obtain a copy of the License at:
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing, software
15
+ # distributed under the License is distributed on an "AS IS" BASIS,
16
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ # See the License for the specific language governing permissions and
18
+ # limitations under the License.
19
+
20
+ cmake_minimum_required(VERSION 3.16)
21
+ project(TinyGUI VERSION 0.1.0 LANGUAGES CXX)
22
+
23
+ set(CMAKE_CXX_STANDARD 17)
24
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
25
+ set(CMAKE_AUTOMOC ON)
26
+ set(CMAKE_AUTOUIC ON)
27
+
28
+ find_package(Qt6 REQUIRED COMPONENTS Core Widgets)
29
+
30
+ add_executable(${PROJECT_NAME}
31
+ src/main.cpp
32
+ src/MainWindow.cpp
33
+ src/MainWindow.h
34
+ src/ConfigPanel.cpp
35
+ src/ConfigPanel.h
36
+ src/ConsolePanel.cpp
37
+ src/ConsolePanel.h
38
+ src/GraphPanel.cpp
39
+ src/GraphPanel.h
40
+ src/ConfigDialog.cpp
41
+ src/ConfigDialog.h
42
+ )
43
+
44
+ target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Widgets)
45
+
46
+ set_target_properties(${PROJECT_NAME} PROPERTIES
47
+ AUTOMOC ON
48
+ AUTOUIC ON
49
+ )
File without changes