def norm2(a):
 if COMPUTE_NORM2:
  logging.info(('computing spectral norm of a %s matrix' % str(a.shape)))
  return scipy.linalg.eigvalsh(a).max()
 else:
  return np.nan

def norm2 ( a ) : if COMPUTE_NORM2 : logging . info ( ( 'computing spectral norm of a %s matrix' % str ( a . shape ) ) ) return scipy . linalg . eigvalsh ( a ) . max ( ) else : return np . nan
spectral norm of a symmetric matrix a .