code: def profile():
      """Create data with op graphs and profile data.
  
      The `profile` run has tags `prof_f` with both profile and op graph data
      (`graph_run_metadata` plugin), and `prof_g` with profile data only
      (`graph_run_metadata_graph` plugin).
      """
  
      logdir = os.path.join(LOGDIR, "profile")
  
      @tf.function
      def f(i):
          return i + i
  
      @tf.function
      def g(i):
          return i * i
  
      with tf.summary.create_file_writer(logdir).as_default():
          for step in range(3):
              # Suppress the profiler deprecation warnings from tf.summary.trace_*.
              with _silence_deprecation_warnings():
                  tf.summary.trace_on(profiler=True)
                  print(f(tf.constant(step)).numpy())
                  tf.summary.trace_export(
                      "prof_f", step=step, profiler_outdir=logdir
                  )
  
                  tf.summary.trace_on(profiler=False)
                  print(g(tf.constant(step)).numpy())
                  tf.summary.trace_export("prof_g", step=step)
  
file_path: tensorboard/tensorboard/plugins/graph/graphs_demo.py
imports: import contextlib
  import os
  import tensorflow
  import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: profile() and returns: unknown, unknown