def cw(X, y=None):
    D = tf.cast(tf.shape(X)[1], tf.float32)
    N = tf.cast(tf.shape(X)[0], tf.float32)
    if (y is None):
        y = silverman_rule_of_thumb(N)
    K = (1 / ((2 * D) - 3))
    A1 = euclidean_norm_squared(tf.subtract(tf.expand_dims(X, 0), tf.expand_dims(X, 1)), axis=2)
    A = ((1 / (N ** 2)) * tf.reduce_sum((1 / tf.sqrt((y + (K * A1))))))
    B1 = euclidean_norm_squared(X, axis=1)
    B = ((2 / N) * tf.reduce_sum((1 / tf.sqrt(((y + 0.5) + (K * B1))))))
    return (((1 / tf.sqrt((1 + y))) + A) - B)
def cw(X, y=None):
    D = tf.cast(tf.shape(X)[1], tf.float32)
    N = tf.cast(tf.shape(X)[0], tf.float32)
    if (y is None):
        y = silverman_rule_of_thumb(N)
    K = (1 / ((2 * D) - 3))
    A1 = euclidean_norm_squared(tf.subtract(tf.expand_dims(X, 0), tf.expand_dims(X, 1)), axis=2)
    A = ((1 / (N ** 2)) * tf.reduce_sum((1 / tf.sqrt((y + (K * A1))))))
    B1 = euclidean_norm_squared(X, axis=1)
    B = ((2 / N) * tf.reduce_sum((1 / tf.sqrt(((y + 0.5) + (K * B1))))))
    return (((1 / tf.sqrt((1 + y))) + A) - B)