def _check_convergence(current_position,<EOL>next_position,<EOL>current_objective,<EOL>next_objective,<EOL>next_gradient,<EOL>grad_tolerance,<EOL>f_relative_tolerance,<EOL>x_tolerance):
grad_converged = norm(next_gradient, dims=<NUM_LIT:1>) <= grad_tolerance<EOL>x_converged = norm(next_position - current_position, dims=<NUM_LIT:1>) <= x_tolerance<EOL>f_converged = (norm(next_objective - current_objective, dims=<NUM_LIT:0>) <=<EOL>f_relative_tolerance * current_objective)<EOL>return grad_converged | x_converged | f_converged<EOL>
Checks if the algorithm satisfies the convergence criteria.