def matrix_multiply_elementwise(A, B):
 if (A.shape != B.shape):
  raise ShapeError()
 shape = A.shape
 return classof(A, B)._new(shape[0], shape[1], (lambda i, j: (A[(i, j)] * B[(i, j)])))

def matrix_multiply_elementwise ( A , B ) : if ( A . shape != B . shape ) : raise ShapeError ( ) shape = A . shape return classof ( A , B ) . _new ( shape [ 0 ] , shape [ 1 ] , ( lambda i , j : ( A [ ( i , j ) ] * B [ ( i , j ) ] ) ) )
return the hadamard product of a and b .