<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_sym_2_tri(symm):
 """convert a 2D symmetric matrix to an upper triangular matrix in 1D format Parameters symm : 2D array Symmetric matrix Returns ------- tri: 1D array Contains elements of upper triangular matrix """


    inds = np.triu_indices_from(symm)
    tri = symm[inds]
    return tri