dot function¶
(Shortest import: from brian2 import dot)
- brian2.units.unitsafefunctions.dot(a, b, out=None)¶
Dot product of two arrays. Specifically,
If both
aandbare 1-D arrays, it is inner product of vectors (without complex conjugation).If both
aandbare 2-D arrays, it is matrix multiplication, but usingmatmul()ora @ bis preferred.If either
aorbis 0-D (scalar), it is equivalent tomultiply()and usingnumpy.multiply(a, b)ora * bis preferred.If
ais an N-D array andbis a 1-D array, it is a sum product over the last axis ofaandb.If
ais an N-D array andbis an M-D array (whereM>=2), it is a sum product over the last axis ofaand the second-to-last axis ofb:dot(a, b)[i,j,k,m] = sum(a[i,j,:] * b[k,:,m])
It uses an optimized BLAS library when possible (see
numpy.linalg).