MCPcopy Create free account
hub / github.com/alibaba/MNN / dot

Method dot

source/math/Matrix.cpp:175–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173}
174
175void 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
193void Matrix::invert(Tensor* dst, const Tensor* src) {
194 MNN_ASSERT(2 == src->buffer().dimensions);

Callers 5

ClusterMethod · 0.80
cosine_similarityFunction · 0.80
test_linear_algebraMethod · 0.80
test_ndarrayMethod · 0.80
normFunction · 0.80

Calls 4

MNNMatrixProdCommonFunction · 0.85
shapeMethod · 0.80
dimensionsMethod · 0.45
lengthMethod · 0.45

Tested by 2

test_linear_algebraMethod · 0.64
test_ndarrayMethod · 0.64