def matrixMult(A, B):
try:
linalg.blas
except AttributeError:
return np.dot(A, B)
if not A.flags['F_CONTIGUOUS']:
AA = A.T
transA = True
else:
AA = A
transA = False
if not B.flags['F_CONTIGUOUS']:
BB = B.T
transB = True
else:
BB = B
transB = False
return linalg.blas.dgemm(alpha=1., a=AA, b=BB, trans_a=transA, trans_b=transB)
评论列表
文章目录