Concatenate each row of a tensor with other rows (not itself)

Hi there,

Is there a way to concatenate each row of tensor with other rows (not itself), for example, I have a N by D tensor and I want to output a N*(N-1) by 2D tensor. A more concrete example:
input: [[1,2,3], [4,5,6], [7,8,9]]
output: [[1,2,3,4,5,6], [1,2,3,7,8,9], [4,5,6,1,2,3], [4,5,6,7,8,9], [7,8,9,1,2,3],[7,8,9,4,5,6]]

Thanks