def sum_squared(X):
 X_flat = X.ravel(order=('F' if np.isfortran(X) else 'C'))
 return np.dot(X_flat, X_flat)

def sum_squared ( X ) : X_flat = X . ravel ( order = ( 'F' if np . isfortran ( X ) else 'C' ) ) return np . dot ( X_flat , X_flat )
compute norm of an array .