How to "cut" a tensor into half in Pytorch?
I have a tensor with shape [1, 2, 96, 96] and would like two tensors with the shape [1, 1, 96, 96], is there a quick way of doing this? Thanks in advance

a, b = tensor.split(1, dim=1) should do the job. By specifying 1 you specify how many elements should be in each split e.g. [1,2,3,4,5,6].split(2) -&gt; [1,2] [3,4] [5,6]. Then dim just specifies which dimension to split over which in your case would be one.
EDIT:
if you wanted to cut it in half more generally use tensor.split(n) where n is half the size of the tensor. So in your specific case if you had shape [1,10,96,96] you would use tensor.split(5,dim=1)
