#NEWLINE# def _diag_dot( self , D , B ) : #NEWLINE# #INDENT# if ( len ( B . shape ) > 1 ) : #NEWLINE# #INDENT# D = D [ ( ( slice ( None ) , ) + ( ( np . newaxis , ) * ( len ( B . shape ) - 1 ) ) ) ] #NEWLINE# #UNINDENT# return ( D * B )