code: def norm(value, dims, order=None):
      """Compute the norm of the given (possibly batched) value.
  
      Args:
        value: A `Tensor` of real dtype.
        dims: An Python integer with the number of non-batching dimensions in the
          value, i.e. `dims=0` (scalars), `dims=1` (vectors), `dims=2` (matrices).
        order: Order of the norm, defaults to `np.inf`.
      """
      if dims == 0:
          return tf.math.abs(value)
      elif dims == 1:
          axis = -1
      elif dims == 2:
          axis = [-1, -2]
      else:
          ValueError(dims)
      if order is None:
          order = np.inf
      return tf.norm(tensor=value, axis=axis, ord=order)
  
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 10 for calling a global function with example usage: norm(value, dims, order) and returns: tf, tf