import tensorflow as tf

    cur_weights = tf.slice(weights_tensors[tf.cast(rand_horizon, tf.int32)], [0, 0], [epi_len, new_w])
    # cur_weights = tf.slice(weights_tensors, [tf.cast(rand_horizon, tf.int32), 0, 0], [1, epi_len, new_w])
    horizon_pred = tf.matmul(pred, cur_weights)
    horizon_tgt = tf.matmul(tgt, cur_weights)
    return horizon_pred, horizon_tgt

