It’s the same as numpy slicing, use colons ( : ) when you have multiple dimensions you need to slice differently, ie: tensor[:-1. 2:-1, :] and semicolons (…) when all following (or previous) dimensions should be kept the same. For example, a tensor of shape: (8, 3, 256) can be sliced as:

tensor[0:1, …] or equivalently tensor[0:1, :, :]
tensor[…, -1] or equivalently tensor [:, :, -1]
tensor[0:1, 0, …] or tensor[0:1, 0, :]
and so on and so on