def _backprop_gradient_pure(dL, L):
dL_dK = np.tril(dL).copy()<EOL>N = L.shape[<NUM_LIT:0>]<EOL>for k in range(N - <NUM_LIT:1>, -<NUM_LIT:1>, -<NUM_LIT:1>):<EOL><INDENT>for j in range(k + <NUM_LIT:1>, N):<EOL><INDENT>for i in range(j, N):<EOL><INDENT>dL_dK[i, k] -= dL_dK[i, j] * L[j, k]<EOL>dL_dK[j, k] -= dL_dK[i, j] * L[i, k]<EOL><DEDENT><DEDENT>for j in range(k + <NUM_LIT:1>, N):<EOL><INDENT>dL_dK[j, k] /= L[k, k]<EOL>dL_dK[k, k] -= L[j, k] * dL_dK[j, k]<EOL><DEDENT>dL_dK[k, k] /= (<NUM_LIT:2> * L[k, k])<EOL><DEDENT>return dL_dK<EOL>
Given the derivative of an objective fn with respect to the cholesky L,
compute the derivate with respect to the original matrix K, defined as

    K = LL^T

where L was obtained by Cholesky decomposition