code: def print_stat(x, message=None):
      
      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)
docs: 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')``.