From 849210cb3f65460c41c9d69f0acf96069942f763 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Wed, 2 Jan 2019 02:10:48 +0100 Subject: [PATCH] [tensor] also set size when viewing fmat/fvec --- src/ai/tensor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ai/tensor.c b/src/ai/tensor.c index 097ee226..60239a15 100644 --- a/src/ai/tensor.c +++ b/src/ai/tensor.c @@ -61,6 +61,7 @@ uint_t aubio_fvec_as_tensor(fvec_t *o, aubio_tensor_t *c) { c->ndim = 1; c->shape[0] = o->length; c->data = &o->data; + c->size = o->length; return AUBIO_OK; } @@ -80,6 +81,7 @@ uint_t aubio_fmat_as_tensor(fmat_t *o, aubio_tensor_t *c) { c->ndim = 2; c->shape[0] = o->height; c->shape[1] = o->length; + c->size = o->height * o->length; c->data = o->data; return AUBIO_OK; } -- 2.11.0