code: def assert_nonnegative(tensor, identifier):
      """Assert if a `Tensor` is nonnegative."""
      return tf.Assert(
          tf.reduce_all(tensor >= tf.zeros([], dtype=tensor.dtype)),
          ["`{}` must be nonnegative".format(identifier)],
      )
  
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.math import gradient
  from tensorflow.python.util import nest
label_desc: Use image node_id 2 for calling a global function with example usage: assert_nonnegative(tensor, identifier) and returns: tf