code: def diag(diag_elements):
      """Function to create tensorflow diagonal matrix with input diagonal entries.
  
      Args:
        diag_elements: tensor with diagonal elements
  
      Returns:
        tf matrix with diagonal entries as diag_elements
      """
      return tf.diag(tf.reshape(diag_elements, [-1]))
  
file_path: cleverhans/cleverhans_v3.1.0/cleverhans/experimental/certification/utils.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: diag(diag_elements) and returns: tf