code: def _check_convergence(
      current_position,
      next_position,
      current_objective,
      next_objective,
      next_gradient,
      grad_tolerance,
      f_relative_tolerance,
      x_tolerance,
      f_absolute_tolerance,
  ):  # pyformat: disable
      """Checks if the algorithm satisfies the convergence criteria."""
      grad_converged = norm(next_gradient, dims=1) <= grad_tolerance
      x_converged = (
          norm(next_position - current_position, dims=1) <= x_tolerance
      )
      f_relative_converged = (
          norm(next_objective - current_objective, dims=0)
          <= f_relative_tolerance * current_objective
      )
      f_absolute_converged = (
          norm(next_objective - current_objective, dims=0)
          <= f_absolute_tolerance
      )
      return (
          grad_converged
          | x_converged
          | f_relative_converged
          | f_absolute_converged
      )
  
file_path: probability/tensorflow_probability/python/optimizer/bfgs_utils.py
imports: import collections
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.optimizer.linesearch.hager_zhang import hager_zhang
label_desc: Use image node_id 11 for calling a global function with example usage: _check_convergence(current_position, next_position, current_objective, next_objective, next_gradient, grad_tolerance, f_relative_tolerance, x_tolerance, f_absolute_tolerance) and returns: unknown