code: def print_stat(x, message=None):
      """A simple print Op that might be easier to use than :meth:`tf.Print`.
      Use it like: ``x = print_stat(x, message='This is x')``.
      """
      if message is None:
          message = x.op.name
      lst = [tf.shape(x), tf.reduce_mean(x)]
      if x.dtype.is_floating:
          lst.append(rms(x))
      return tf.Print(
          x,
          lst + [x],
          summarize=20,
          message=message,
          name="print_" + x.op.name,
      )
  
imports: import tensorflow
  from ..compat import tfv1
label_desc: Use image node_id 1 for calling a global function with example usage: print_stat(x, message) and returns: tf