From: Paul Brossier Date: Wed, 2 Jan 2019 01:10:48 +0000 (+0100) Subject: [tensor] also set size when viewing fmat/fvec X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=a5199ad7917a7478c1dc89e3a07ffd3da70a9192;p=aubio.git [tensor] also set size when viewing fmat/fvec --- 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; }