def norm(A):
return np.sqrt(A.multiply(A).sum(<NUM_LIT:1>).A1) if issparse(A) else np.sqrt(np.einsum('<STR_LIT>', A, A))<EOL>
computes the L2-norm along axis 1 (e.g. genes or embedding dimensions) equivalent to np.linalg.norm(A, axis=1)