Thanks a lot, based on what yo said, I wrote this code, but I do not know what are the numbers -1 and -2, do you have any idea about it?
import torch
input = torch.zeros((2, 1, 4, 2))
print(input)

temp = torch.ones((input.shape[0], input.shape[1], input.shape[2], 1))
#temp = torch.ones((2, 1, 4, 1))

input = torch.cat((temp, input), 3)
print(input)

input = torch.cat((input, temp), -1)
print(input)

temp = torch.ones((input.shape[0], input.shape[1], 1, input.shape[3]))

input = torch.cat((input, temp), -2)
print(input)

input = torch.cat((temp, input), -2)
print(input)


The result is this:
tensor([[[[1., 1., 1., 1.],
          [1., 0., 0., 1.],
          [1., 0., 0., 1.],
          [1., 0., 0., 1.],
          [1., 0., 0., 1.],
          [1., 1., 1., 1.]]],


        [[[1., 1., 1., 1.],
          [1., 0., 0., 1.],
          [1., 0., 0., 1.],
          [1., 0., 0., 1.],
          [1., 0., 0., 1.],
          [1., 1., 1., 1.]]]])