emx-onnx-cgen 0.2.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.

Potentially problematic release.


This version of emx-onnx-cgen might be problematic. Click here for more details.

Files changed (93) hide show
  1. emx_onnx_cgen-0.2.0/MANIFEST.in +1 -0
  2. emx_onnx_cgen-0.2.0/PKG-INFO +128 -0
  3. emx_onnx_cgen-0.2.0/README.md +121 -0
  4. emx_onnx_cgen-0.2.0/build_backend.py +81 -0
  5. emx_onnx_cgen-0.2.0/pyproject.toml +20 -0
  6. emx_onnx_cgen-0.2.0/setup.cfg +4 -0
  7. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/__init__.py +6 -0
  8. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/__main__.py +9 -0
  9. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/_build_info.py +4 -0
  10. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/cli.py +328 -0
  11. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/codegen/__init__.py +25 -0
  12. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/codegen/c_emitter.py +9044 -0
  13. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/compiler.py +601 -0
  14. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/dtypes.py +40 -0
  15. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/errors.py +14 -0
  16. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/ir/__init__.py +3 -0
  17. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/ir/model.py +55 -0
  18. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/__init__.py +3 -0
  19. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/arg_reduce.py +99 -0
  20. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/attention.py +421 -0
  21. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/average_pool.py +229 -0
  22. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/batch_normalization.py +116 -0
  23. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/cast.py +70 -0
  24. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/common.py +72 -0
  25. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/concat.py +31 -0
  26. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/constant_of_shape.py +85 -0
  27. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/conv.py +192 -0
  28. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/cumsum.py +118 -0
  29. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/depth_space.py +114 -0
  30. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/dropout.py +46 -0
  31. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/elementwise.py +164 -0
  32. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/expand.py +151 -0
  33. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/eye_like.py +43 -0
  34. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/flatten.py +60 -0
  35. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/gather.py +48 -0
  36. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/gather_elements.py +60 -0
  37. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/gemm.py +139 -0
  38. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/grid_sample.py +149 -0
  39. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/group_normalization.py +68 -0
  40. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/identity.py +43 -0
  41. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/instance_normalization.py +50 -0
  42. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/layer_normalization.py +110 -0
  43. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/logsoftmax.py +47 -0
  44. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/lp_normalization.py +45 -0
  45. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/lrn.py +104 -0
  46. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/lstm.py +355 -0
  47. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/matmul.py +120 -0
  48. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/maxpool.py +195 -0
  49. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/mean_variance_normalization.py +49 -0
  50. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/negative_log_likelihood_loss.py +250 -0
  51. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/pad.py +287 -0
  52. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/range.py +104 -0
  53. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/reduce.py +544 -0
  54. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/registry.py +51 -0
  55. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/reshape.py +188 -0
  56. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/resize.py +445 -0
  57. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/rms_normalization.py +67 -0
  58. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/shape.py +78 -0
  59. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/size.py +33 -0
  60. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/slice.py +425 -0
  61. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/softmax.py +47 -0
  62. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/softmax_cross_entropy_loss.py +129 -0
  63. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/split.py +150 -0
  64. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/squeeze.py +161 -0
  65. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/tile.py +81 -0
  66. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/transpose.py +46 -0
  67. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/unsqueeze.py +157 -0
  68. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/variadic.py +95 -0
  69. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/lowering/where.py +73 -0
  70. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/onnx_import.py +261 -0
  71. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/ops.py +565 -0
  72. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/runtime/__init__.py +1 -0
  73. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/runtime/evaluator.py +2206 -0
  74. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen/validation.py +76 -0
  75. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen.egg-info/PKG-INFO +128 -0
  76. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen.egg-info/SOURCES.txt +91 -0
  77. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen.egg-info/dependency_links.txt +1 -0
  78. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen.egg-info/entry_points.txt +2 -0
  79. emx_onnx_cgen-0.2.0/src/emx_onnx_cgen.egg-info/top_level.txt +2 -0
  80. emx_onnx_cgen-0.2.0/src/shared/__init__.py +2 -0
  81. emx_onnx_cgen-0.2.0/src/shared/scalar_functions.py +2405 -0
  82. emx_onnx_cgen-0.2.0/src/shared/scalar_types.py +243 -0
  83. emx_onnx_cgen-0.2.0/tests/test_cli.py +71 -0
  84. emx_onnx_cgen-0.2.0/tests/test_codegen_data_file.py +43 -0
  85. emx_onnx_cgen-0.2.0/tests/test_codegen_signature.py +50 -0
  86. emx_onnx_cgen-0.2.0/tests/test_endtoend_features.py +142 -0
  87. emx_onnx_cgen-0.2.0/tests/test_golden.py +461 -0
  88. emx_onnx_cgen-0.2.0/tests/test_golden_ops.py +560 -0
  89. emx_onnx_cgen-0.2.0/tests/test_mixed_dtypes.py +129 -0
  90. emx_onnx_cgen-0.2.0/tests/test_multi_output.py +44 -0
  91. emx_onnx_cgen-0.2.0/tests/test_official_onnx_files.py +516 -0
  92. emx_onnx_cgen-0.2.0/tests/test_onnx_import.py +41 -0
  93. emx_onnx_cgen-0.2.0/tests/test_ops.py +3520 -0
@@ -0,0 +1 @@
1
+ include build_backend.py
@@ -0,0 +1,128 @@
1
+ Metadata-Version: 2.4
2
+ Name: emx-onnx-cgen
3
+ Version: 0.2.0
4
+ Summary: emmtrix ONNX-to-C Code Generator
5
+ Requires-Python: >=3.10
6
+ Description-Content-Type: text/markdown
7
+
8
+ # emmtrix ONNX-to-C Code Generator (emx-onnx-cgen)
9
+
10
+ [![PyPI - Version](https://img.shields.io/pypi/v/emx-onnx-cgen.svg)](https://pypi.org/project/emx-onnx-cgen)
11
+
12
+ `emx-onnx-cgen` compiles ONNX models to portable, deterministic C code for deeply embedded systems. The generated code is designed to run without dynamic memory allocation, operating systems, or external runtimes, making it suitable for safety-critical and resource-constrained targets.
13
+
14
+ Key characteristics:
15
+
16
+ - **No dynamic memory allocation** (`malloc`, `free`, heap usage)
17
+ - **Static, compile-time known memory layout** for parameters, activations, and temporaries
18
+ - **Deterministic control flow** (explicit loops, no hidden dispatch or callbacks)
19
+ - **No OS or libc dependencies** beyond basic C
20
+ - **Single-threaded execution model**
21
+ - **Bitwise-stable code generation** for reproducible builds
22
+ - **Readable, auditable C code** suitable for certification and code reviews
23
+ - Designed for **bare-metal and RTOS-based systems**
24
+
25
+ ## Goals
26
+
27
+ - Correctness-first compilation with outputs comparable to ONNX Runtime.
28
+ - Deterministic and reproducible C code generation.
29
+ - Clean, pass-based compiler architecture (import → normalize → optimize → lower → emit).
30
+ - Minimal C runtime with explicit, predictable data movement.
31
+
32
+ ## Non-goals
33
+
34
+ - Aggressive performance optimizations in generated C.
35
+ - Implicit runtime dependencies or dynamic loading.
36
+ - Training/backpropagation support.
37
+
38
+ ## Features
39
+
40
+ - CLI for ONNX-to-C compilation and verification.
41
+ - Deterministic codegen with explicit tensor shapes and loop nests.
42
+ - Minimal C runtime templates in `templates/`.
43
+ - ONNX Runtime comparison for end-to-end validation.
44
+ - Official ONNX operator coverage tracking.
45
+ - Support for a wide range of ONNX operators (see `OFFICIAL_ONNX_FILE_SUPPORT.md`).
46
+ - Supported data types:
47
+ - `float`, `double`, `float16`
48
+ - `int8_t`, `uint8_t`, `int16_t`, `uint16_t`, `int32_t`, `uint32_t`, `int64_t`, `uint64_t`
49
+ - `bool`
50
+ - Supporting dynamic dimensions by utilizing C99 variable-length arrays (VLAs).
51
+
52
+ ## Installation
53
+
54
+ Install the package directly from PyPI (recommended):
55
+
56
+ ```bash
57
+ pip install emx-onnx-cgen
58
+ ```
59
+
60
+ Optional for verification and tests:
61
+
62
+ - `onnxruntime`
63
+ - `numpy`
64
+ - A C compiler (`cc`, `gcc`, `clang` or via `--cc`)
65
+
66
+ ## Quickstart
67
+
68
+ Compile an ONNX model into a C source file:
69
+
70
+ ```bash
71
+ emx-onnx-cgen compile path/to/model.onnx build/model.c
72
+ ```
73
+
74
+ Verify an ONNX model end-to-end against ONNX Runtime:
75
+
76
+ ```bash
77
+ emx-onnx-cgen verify path/to/model.onnx
78
+ ```
79
+
80
+ ## CLI Reference
81
+
82
+ `emx-onnx-cgen` provides two subcommands: `compile` and `verify`.
83
+
84
+ ### `compile`
85
+
86
+ ```bash
87
+ emx-onnx-cgen compile <model.onnx> <output.c> [options]
88
+ ```
89
+
90
+ Options:
91
+
92
+ - `--template-dir`: Directory containing the C templates (default: `templates`).
93
+ - `--model-name`: Override the generated model name (default: output file stem).
94
+ - `--emit-testbench`: Emit a JSON-producing `main()` testbench for validation.
95
+ - `--emit-data-file`: Emit constant data arrays into a companion `_data` C file.
96
+ - `--no-restrict-arrays`: Disable `restrict` qualifiers on generated array parameters.
97
+
98
+ ### `verify`
99
+
100
+ ```bash
101
+ emx-onnx-cgen verify <model.onnx> [options]
102
+ ```
103
+
104
+ Options:
105
+
106
+ - `--template-dir`: Directory containing the C templates (default: `templates`).
107
+ - `--model-name`: Override the generated model name (default: model file stem).
108
+ - `--cc`: Explicit C compiler command for building the testbench binary.
109
+
110
+ ## Output
111
+
112
+ By default, the compiler emits a single C source file that includes:
113
+
114
+ - A generated entry point that mirrors the ONNX graph inputs/outputs.
115
+ - Tensor buffers for constants and temporaries.
116
+ - A lightweight runtime implemented via templates in `templates/`.
117
+
118
+ When `--emit-data-file` is enabled, the main C source declares constant arrays
119
+ as `extern`, and a second file named like the output with a `_data` suffix
120
+ contains the constant definitions.
121
+
122
+ ## Official ONNX test coverage
123
+
124
+ See [`OFFICIAL_ONNX_FILE_SUPPORT.md`](OFFICIAL_ONNX_FILE_SUPPORT.md) for the generated support matrix.
125
+
126
+ ## Maintained by
127
+
128
+ This project is maintained by [emmtrix](https://www.emmtrix.com).
@@ -0,0 +1,121 @@
1
+ # emmtrix ONNX-to-C Code Generator (emx-onnx-cgen)
2
+
3
+ [![PyPI - Version](https://img.shields.io/pypi/v/emx-onnx-cgen.svg)](https://pypi.org/project/emx-onnx-cgen)
4
+
5
+ `emx-onnx-cgen` compiles ONNX models to portable, deterministic C code for deeply embedded systems. The generated code is designed to run without dynamic memory allocation, operating systems, or external runtimes, making it suitable for safety-critical and resource-constrained targets.
6
+
7
+ Key characteristics:
8
+
9
+ - **No dynamic memory allocation** (`malloc`, `free`, heap usage)
10
+ - **Static, compile-time known memory layout** for parameters, activations, and temporaries
11
+ - **Deterministic control flow** (explicit loops, no hidden dispatch or callbacks)
12
+ - **No OS or libc dependencies** beyond basic C
13
+ - **Single-threaded execution model**
14
+ - **Bitwise-stable code generation** for reproducible builds
15
+ - **Readable, auditable C code** suitable for certification and code reviews
16
+ - Designed for **bare-metal and RTOS-based systems**
17
+
18
+ ## Goals
19
+
20
+ - Correctness-first compilation with outputs comparable to ONNX Runtime.
21
+ - Deterministic and reproducible C code generation.
22
+ - Clean, pass-based compiler architecture (import → normalize → optimize → lower → emit).
23
+ - Minimal C runtime with explicit, predictable data movement.
24
+
25
+ ## Non-goals
26
+
27
+ - Aggressive performance optimizations in generated C.
28
+ - Implicit runtime dependencies or dynamic loading.
29
+ - Training/backpropagation support.
30
+
31
+ ## Features
32
+
33
+ - CLI for ONNX-to-C compilation and verification.
34
+ - Deterministic codegen with explicit tensor shapes and loop nests.
35
+ - Minimal C runtime templates in `templates/`.
36
+ - ONNX Runtime comparison for end-to-end validation.
37
+ - Official ONNX operator coverage tracking.
38
+ - Support for a wide range of ONNX operators (see `OFFICIAL_ONNX_FILE_SUPPORT.md`).
39
+ - Supported data types:
40
+ - `float`, `double`, `float16`
41
+ - `int8_t`, `uint8_t`, `int16_t`, `uint16_t`, `int32_t`, `uint32_t`, `int64_t`, `uint64_t`
42
+ - `bool`
43
+ - Supporting dynamic dimensions by utilizing C99 variable-length arrays (VLAs).
44
+
45
+ ## Installation
46
+
47
+ Install the package directly from PyPI (recommended):
48
+
49
+ ```bash
50
+ pip install emx-onnx-cgen
51
+ ```
52
+
53
+ Optional for verification and tests:
54
+
55
+ - `onnxruntime`
56
+ - `numpy`
57
+ - A C compiler (`cc`, `gcc`, `clang` or via `--cc`)
58
+
59
+ ## Quickstart
60
+
61
+ Compile an ONNX model into a C source file:
62
+
63
+ ```bash
64
+ emx-onnx-cgen compile path/to/model.onnx build/model.c
65
+ ```
66
+
67
+ Verify an ONNX model end-to-end against ONNX Runtime:
68
+
69
+ ```bash
70
+ emx-onnx-cgen verify path/to/model.onnx
71
+ ```
72
+
73
+ ## CLI Reference
74
+
75
+ `emx-onnx-cgen` provides two subcommands: `compile` and `verify`.
76
+
77
+ ### `compile`
78
+
79
+ ```bash
80
+ emx-onnx-cgen compile <model.onnx> <output.c> [options]
81
+ ```
82
+
83
+ Options:
84
+
85
+ - `--template-dir`: Directory containing the C templates (default: `templates`).
86
+ - `--model-name`: Override the generated model name (default: output file stem).
87
+ - `--emit-testbench`: Emit a JSON-producing `main()` testbench for validation.
88
+ - `--emit-data-file`: Emit constant data arrays into a companion `_data` C file.
89
+ - `--no-restrict-arrays`: Disable `restrict` qualifiers on generated array parameters.
90
+
91
+ ### `verify`
92
+
93
+ ```bash
94
+ emx-onnx-cgen verify <model.onnx> [options]
95
+ ```
96
+
97
+ Options:
98
+
99
+ - `--template-dir`: Directory containing the C templates (default: `templates`).
100
+ - `--model-name`: Override the generated model name (default: model file stem).
101
+ - `--cc`: Explicit C compiler command for building the testbench binary.
102
+
103
+ ## Output
104
+
105
+ By default, the compiler emits a single C source file that includes:
106
+
107
+ - A generated entry point that mirrors the ONNX graph inputs/outputs.
108
+ - Tensor buffers for constants and temporaries.
109
+ - A lightweight runtime implemented via templates in `templates/`.
110
+
111
+ When `--emit-data-file` is enabled, the main C source declares constant arrays
112
+ as `extern`, and a second file named like the output with a `_data` suffix
113
+ contains the constant definitions.
114
+
115
+ ## Official ONNX test coverage
116
+
117
+ See [`OFFICIAL_ONNX_FILE_SUPPORT.md`](OFFICIAL_ONNX_FILE_SUPPORT.md) for the generated support matrix.
118
+
119
+ ## Maintained by
120
+
121
+ This project is maintained by [emmtrix](https://www.emmtrix.com).
@@ -0,0 +1,81 @@
1
+ from __future__ import annotations
2
+
3
+ from datetime import datetime, timezone
4
+ from pathlib import Path
5
+ import subprocess
6
+
7
+ from setuptools import build_meta as _build_meta
8
+
9
+ BUILD_INFO_MODULE = (
10
+ Path(__file__).resolve().parent / "src" / "emx_onnx_cgen" / "_build_info.py"
11
+ )
12
+
13
+
14
+ def _write_build_info() -> None:
15
+ build_date = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
16
+ git_version = _read_git_version()
17
+
18
+ # Ensure the package directory exists (useful for clean checkouts / CI)
19
+ BUILD_INFO_MODULE.parent.mkdir(parents=True, exist_ok=True)
20
+
21
+ BUILD_INFO_MODULE.write_text(
22
+ '"""Auto-generated by build backend. Do not edit."""\n'
23
+ f"BUILD_DATE = {build_date!r}\n"
24
+ f"GIT_VERSION = {git_version!r}\n",
25
+ encoding="utf-8",
26
+ )
27
+
28
+
29
+ def _read_git_version() -> str:
30
+ try:
31
+ result = subprocess.run(
32
+ ["git", "rev-parse", "--short", "HEAD"],
33
+ check=True,
34
+ capture_output=True,
35
+ text=True,
36
+ )
37
+ except (OSError, subprocess.CalledProcessError):
38
+ return "unknown"
39
+ return result.stdout.strip() or "unknown"
40
+
41
+
42
+ def build_wheel(wheel_directory, config_settings=None, metadata_directory=None):
43
+ _write_build_info()
44
+ return _build_meta.build_wheel(
45
+ wheel_directory,
46
+ config_settings=config_settings,
47
+ metadata_directory=metadata_directory,
48
+ )
49
+
50
+
51
+ def build_editable(wheel_directory, config_settings=None, metadata_directory=None):
52
+ _write_build_info()
53
+ return _build_meta.build_editable(
54
+ wheel_directory,
55
+ config_settings=config_settings,
56
+ metadata_directory=metadata_directory,
57
+ )
58
+
59
+
60
+ def build_sdist(sdist_directory, config_settings=None):
61
+ return _build_meta.build_sdist(sdist_directory, config_settings=config_settings)
62
+
63
+
64
+ def get_requires_for_build_wheel(config_settings=None):
65
+ return _build_meta.get_requires_for_build_wheel(config_settings=config_settings)
66
+
67
+
68
+ def get_requires_for_build_editable(config_settings=None):
69
+ return _build_meta.get_requires_for_build_editable(config_settings=config_settings)
70
+
71
+
72
+ def prepare_metadata_for_build_wheel(metadata_directory, config_settings=None):
73
+ return _build_meta.prepare_metadata_for_build_wheel(
74
+ metadata_directory, config_settings=config_settings
75
+ )
76
+
77
+
78
+ def prepare_metadata_for_build_editable(metadata_directory, config_settings=None):
79
+ return _build_meta.prepare_metadata_for_build_editable(
80
+ metadata_directory, config_settings=config_settings
81
+ )
@@ -0,0 +1,20 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61"]
3
+ build-backend = "build_backend"
4
+ backend-path = ["."]
5
+
6
+ [project]
7
+ name = "emx-onnx-cgen"
8
+ version = "0.2.0"
9
+ description = "emmtrix ONNX-to-C Code Generator"
10
+ readme = { file = "README.md", content-type = "text/markdown" }
11
+ requires-python = ">=3.10"
12
+
13
+ [project.scripts]
14
+ emx-onnx-cgen = "emx_onnx_cgen.cli:main"
15
+
16
+ [tool.setuptools]
17
+ package-dir = {"" = "src"}
18
+
19
+ [tool.setuptools.packages.find]
20
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,6 @@
1
+ """ONNX to C compiler MVP."""
2
+
3
+ from .compiler import Compiler
4
+ from .errors import CodegenError, ShapeInferenceError, UnsupportedOpError
5
+
6
+ __all__ = ["Compiler", "CodegenError", "ShapeInferenceError", "UnsupportedOpError"]
@@ -0,0 +1,9 @@
1
+ from __future__ import annotations
2
+
3
+ import sys
4
+
5
+ from .cli import main
6
+
7
+
8
+ if __name__ == "__main__":
9
+ raise SystemExit(main(sys.argv[1:]))
@@ -0,0 +1,4 @@
1
+ """Build metadata for emx_onnx_cgen."""
2
+
3
+ BUILD_DATE = "unknown"
4
+ GIT_VERSION = "unknown"