Sure.
x is a tensor with 5 dimensions.
We take the zero index in third dimension so x is now a tensor with 4 dimensions.
tensor.shape returns the size of each 4 dimensions as a list --> [dim1 size, dim2 size, dim3 size, dim4 size] if we use shape[-2] we take the list but only until the second last index so we get [dim1 size, dim2 size]