Suppose I have
tensor([[[-1., 1., 1., 1.],
         [1., 1., 1., 1.],
         [-1., 1., 1., 1.],
         [1., 1., 1., 1.]]])

How can I get
tensor([[[-1., 1., 1., 1., -1],
         [1., 1., 1., 1., 1.],
         [-1., 1., 1., 1., -1],
         [1., 1., 1., 1., 1],
         [-1., 1., 1., 1., -1]]])

In particular, for a N x N matrix, I want another N+1 x N+1 matrix such that the (N+1)th entry is the same as the 0th entry.
Also, I have multiple matrices. For instance, I have 50 4 x 4 matrixes. I want 50 new 5 x 5 matrices after the above operation.