def hadamard_product(*matrices):
 if (not matrices):
  raise TypeError('Empty Hadamard product is undefined')
 validate(*matrices)
 if (len(matrices) == 1):
  return matrices[0]
 else:
  return HadamardProduct(*matrices).doit()

def hadamard_product ( * matrices ) : if ( not matrices ) : raise TypeError ( 'Empty Hadamard product is undefined' ) validate ( * matrices ) if ( len ( matrices ) == 1 ) : return matrices [ 0 ] else : return HadamardProduct ( * matrices ) . doit ( )
return the elementwise product of matrices .