[tensor] add warning in aubio_tensor_as_fmat, to be avoided
authorPaul Brossier <piem@piem.org>
Tue, 29 Jan 2019 02:31:38 +0000 (03:31 +0100)
committerPaul Brossier <piem@piem.org>
Wed, 29 Dec 2021 16:52:02 +0000 (11:52 -0500)
src/ai/tensor.c

index 976706a..a15818e 100644 (file)
@@ -93,6 +93,8 @@ uint_t aubio_tensor_as_fmat(aubio_tensor_t *c, fmat_t *o) {
   o->height = c->shape[0];
   o->length = c->size / c->shape[0];
   o->data = c->data;
+  // o was allocated on the stack, data[1] may be NULL
+  AUBIO_WRN("aubio_tensor_as_fmat will not create a usable table of rows\n");
   return AUBIO_OK;
 }