Custom loss function label ordering


I am curious if the ordering of the true_labels ever change when we are calculating the gradient and hessian of the custom loss function?

def custom_loss(true_labels, preds):
    p = preds
    grad = p - y
    hess = p * (1 - p)
    return grad, hess

I’d like to manipulate / interact with the predictions with a matrix of data that has the same number of rows of as the predictions, and the ordering of the operations are effectively element-wise.

If the order is not effected, would the order be effected if I trained with n_jobs =-1 / nthreads = -1?