pg020196 / Neural-Network-Translator

This repository contains a neural network translator which can translate neural network models to native code.
MIT License
8 stars 4 forks source link

Fix some GCC translation issues #138

Closed diveflo closed 3 years ago

diveflo commented 3 years ago

This fixes a few issues with the current gcc translation

Move network definition variables from header to c file

We define the network definition variables (with external linkage) in our header. When we include that header into multiple translation units, i.e., nn_model & our additional "main" file, we define the variables multiple times (with external linkage). -> compile error. In the arduino example it works as we "extern include" the nn_model.h. However, that's not easily understandable and not the way most people would include a header.

Include guard on header

The header file was missing an include guard -> we declare the functions multiple times once the header is included in any additional file besides nn_model.c

HORIZONTAL_STRIDE

HORIZONTAL_STRIDE was not set to 0 in case there isn't any stride defined.