But what if I can guarantee that concatenated tensors are views of the same tensor. Imagine I have a tensor
t = torch.randn(400)

and I need to calculate the mean of every 100 elements. In order to avoid any loops, I can easily do something like this:
means = t.view(4, -1).mean(dim=1)

but let’s say I need to calculate mean() of intersecting segments, in particular:
means = torch.cat((t[0:200], t[100:300], t[200:400]), dim=0).mean(dim=1)

Can I do it efficiently, without tensor copy happening in torch.cat()?