def _scalar_vectorized(scalar, M):
 return (scalar[:, np.newaxis, np.newaxis] * M)

def _scalar_vectorized ( scalar , M ) : return ( scalar [ : , np . newaxis , np . newaxis ] * M )
scalar product between scalars and matrices .