| 173 | } |
| 174 | |
| 175 | void Matrix::dot(Tensor* C, const Tensor* A, const Tensor* B) { |
| 176 | MNN_ASSERT(NULL != C); |
| 177 | MNN_ASSERT(NULL != B); |
| 178 | MNN_ASSERT(NULL != A); |
| 179 | MNN_ASSERT(2 == C->dimensions()); |
| 180 | MNN_ASSERT(2 == B->dimensions()); |
| 181 | MNN_ASSERT(2 == A->dimensions()); |
| 182 | MNN_ASSERT(A->shape() == B->shape()); |
| 183 | MNN_ASSERT(A->shape() == C->shape()); |
| 184 | const int height = A->length(0); |
| 185 | const int width = A->length(1); |
| 186 | |
| 187 | const int aw = A->stride(0); |
| 188 | const int bw = B->stride(0); |
| 189 | const int cw = C->stride(0); |
| 190 | MNNMatrixProdCommon(C->host<float>(), A->host<float>(), B->host<float>(), width, cw, aw, bw, height); |
| 191 | } |
| 192 | |
| 193 | void Matrix::invert(Tensor* dst, const Tensor* src) { |
| 194 | MNN_ASSERT(2 == src->buffer().dimensions); |