[tensor] use cblas alias in matmul, allow n-dimensional tensors
authorPaul Brossier <piem@piem.org>
Mon, 28 Jan 2019 21:50:54 +0000 (22:50 +0100)
committerPaul Brossier <piem@piem.org>
Wed, 29 Dec 2021 16:52:00 +0000 (11:52 -0500)
src/ai/tensor.c

index 0c94fc9..cbf2af9 100644 (file)
@@ -228,8 +228,9 @@ void aubio_tensor_matmul(aubio_tensor_t *a, aubio_tensor_t *b,
     }
   }
 #else
-  cblas_sgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans, a->shape[0],
-      b->shape[1], b->shape[0], 1.F, a->buffer, a->shape[1], b->buffer,
-      b->shape[1], 0.F, c->buffer, b->shape[1]);
+  aubio_cblas__gemm(CblasRowMajor, CblasNoTrans, CblasNoTrans, a->shape[0],
+      b->size/b->shape[0], b->shape[0], 1.F, a->buffer, a->size/a->shape[0],
+      b->buffer,
+      b->size/b->shape[0], 0.F, c->buffer, b->size/b->shape[0]);
 #endif
 }