def create_cost_distance(l, r, d): dd = tf.sqrt(tf.reduce_sum(tf.squared_difference(l,r), reduction_indices=1)); dd = tf.squared_difference(dd, d); return tf.reduce_mean(dd);