From 340608cad52b58d84779e185faa183c56875980c Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Thu, 21 Mar 2019 18:28:20 +0200 Subject: [PATCH] Fix NN enum sizes. * Fixes issue #491 * Since enums are now short, make sure NN layer types are 4 bytes. --- src/omv/nn/nn.c | 2 +- src/omv/nn/nn.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/omv/nn/nn.c b/src/omv/nn/nn.c index d111282d7..7077bd98c 100644 --- a/src/omv/nn/nn.c +++ b/src/omv/nn/nn.c @@ -94,7 +94,7 @@ int nn_load_network(nn_t *net, const char *path) layer_t *prev_layer = NULL; for (int i=0; in_layers; i++) { layer_t *layer; - layer_type_t layer_type; + uint32_t layer_type; // Read layer type read_data(&fp, &layer_type, 4); diff --git a/src/omv/nn/nn.h b/src/omv/nn/nn.h index 0ee115240..bfc852ac0 100644 --- a/src/omv/nn/nn.h +++ b/src/omv/nn/nn.h @@ -27,7 +27,7 @@ typedef enum { } network_type_t; #define NN_LAYER_BASE \ - layer_type_t type; \ + uint32_t type; \ uint32_t n, c, h, w;\ struct _layer *prev;\ struct _layer *next \ @@ -62,7 +62,7 @@ typedef struct { typedef struct { NN_LAYER_BASE; - pool_type_t ptype; + uint32_t ptype; uint32_t krn_dim; uint32_t krn_str; uint32_t krn_pad;