import tensorflow as tf


def cw_1d(X, y=None):

    def N0(mean, variance):
        return 1.0/(tf.sqrt(2.0 * m.pi * variance)) * tf.exp((-(mean**2))/(2*variance))

    N = tf.cast(tf.shape(X)[0], tf.float32)
    if y is None:
