code: def create_scalar_summary(name, v):
      """
      Args:
          name (str):
          v (float): scalar value
      Returns:
          tf.Summary: a tf.Summary object with name and simple scalar value v.
      """
      assert isinstance(name, six.string_types), type(name)
      v = float(v)
      s = tf.Summary()
      s.value.add(tag=name, simple_value=v)
      return s
  
file_path: tensorpack/tensorpack/tfutils/summary.py
imports: import re
  from contextlib import contextmanager
  import six
  from six.moves import range
  from tensorflow.python.training import moving_averages
  from ..compat import tfv1
  from ..utils import logger
  from ..utils.argtools import graph_memoized
  from ..utils.naming import MOVING_SUMMARY_OPS_KEY
  from .scope_utils import cached_name_scope
  from .symbolic_functions import rms
  from .tower import get_current_tower_context
label_desc: Use image node_id 3 for calling a global function with example usage: create_scalar_summary(name, v) and returns: s