You have a 2-row tensor and your index tensor is [2, 3], so I think what you are asking is a t[:, 2].sum() and t[:, 3].sum(), correct me if I am wrong, if that is so then how are you getting [4.0, 8.5]?