From 49ac607f9f76836a0596f7dc0dda66ef8402c4dd Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Wed, 16 Jan 2019 22:01:01 +0100 Subject: [PATCH] [conv2d] fix debug string, clean up --- src/ai/conv2d.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/ai/conv2d.c b/src/ai/conv2d.c index 53bdaefd..da66cd08 100644 --- a/src/ai/conv2d.c +++ b/src/ai/conv2d.c @@ -80,10 +80,8 @@ failure: void del_aubio_conv2d(aubio_conv2d_t *c) { AUBIO_ASSERT(c); - // destroy internals here - if (c->kernel) { + if (c->kernel) del_aubio_tensor(c->kernel); - } if (c->bias) del_fvec(c->bias); AUBIO_FREE(c); @@ -147,6 +145,7 @@ uint_t aubio_conv2d_get_output_shape(aubio_conv2d_t *c, padding_start[0] = 0; padding_start[1] = 0; + break; //case PAD_CAUSAL: // // TODO @@ -193,13 +192,17 @@ void aubio_conv2d_debug(aubio_conv2d_t *c, aubio_tensor_t *input_tensor) uint_t n_params = (c->kernel->shape[0] * c->kernel->shape[2] + 1) * c->kernel->shape[1] * c->kernel->shape[3]; - AUBIO_DBG("conv2d: %15s ¤ conv2d %s" - " : (%d, %d, %d)" - " (%d params, stride (%d, %d), pad_start [%d, %d])\n", - aubio_tensor_get_shape_string(input_tensor), - aubio_tensor_get_shape_string(c->kernel), - c->output_shape[0], c->output_shape[1], c->output_shape[2], - n_params, + const char_t *tensor_str = aubio_tensor_get_shape_string(input_tensor); + //AUBIO_DBG("conv2d: kernel_shape_str %s\n", kernel_shape_str); + AUBIO_DBG("conv2d: %15s -> (%d, %d, %d)", + tensor_str, + c->output_shape[0], c->output_shape[1], c->output_shape[2]); + tensor_str = aubio_tensor_get_shape_string(c->kernel); + AUBIO_DBG(" (n_params=%d, kernel_shape=(%d, %d)," + " weigths=%s, stride (%d, %d), pad_start [%d, %d]" + " pad_end [%d, %d])\n", + n_params, c->kernel_shape[0], c->kernel_shape[1], + tensor_str, c->stride_shape[0], c->stride_shape[1], -c->padding_start[0], -c->padding_start[1]); } -- 2.11.0