Suppose I have a tensor that looks like this:
a = torch.tensor([
[1. 2.],
[3. 4.],
[5. 6.],
[7. 8.]
])
Is there a way to compute the mean of every two row tensors (without overlap) in a
without looping?
The expected output tensor would be:
torch.tensor([
[2. 3.], # mean of 1st and 2nd row tensors in `a`
[6. 7.] # mean of 3rd and 4th row tensors in `a`
])