import tensorflow as tf


def sample_pair(batch):
    num_sam = tools.shape(batch)[0]
    index = tf.range(num_sam)
    tgt1 = tf.slice(batch, [0, 1], [num_sam, 1])
    pred1 = tf.slice(batch, [0, 0], [num_sam, 1])

    def uniform():
