def stddev(x): x = tf.to_float(x) return tf.sqrt(tf.reduce_mean(tf.square(tf.abs (tf.sub(x, tf.fill(x.get_shape(), tf.reduce_mean(x)))))))