Hi,
If each element of a tuple/list has a tensor, and I would like to find the mean of each tensor at dim=1. How can it be done without the need of a for loop?
Example:
sample = (tensor([[0.], [0.], [0.]], device='cuda:0'), 
                 tensor([[2., 3.], [2., 4.], [4., 3.]], device='cuda:0'),
                 tensor([[1.], [3.], [4.]], device='cuda:0'), 
                 tensor([[1., 3.], [0., 0.], [4., 2.]], device='cuda:0'))

sample = (tensor([[0.], [0.], [0.]], device=‘cuda:0’),
tensor([[2.5.], [3.], [3.5]], device=‘cuda:0’),
tensor([[1.], [3.], [4.]], device=‘cuda:0’),
tensor([[2.], [0.], [3.]], device=‘cuda:0’))
Thanks