@J_Johnson that can be done. But here is the caveat-
Eg.
x=torch.randn(10,3)
RowSplits=[0,2,5,7,9]

Which means the splits are x[0:2], x[2:5], x[5:7], x[7:9]
Now to make each of them of same size, I shall have to pad zeros in between these rows. Say I write new x into x_ like
   x_[0:2]=x[0:2]
    x_[2]=0(inserted padding)
    x_[3:6]=x[2:5](no padding needed here) 

etc. Now how can I do it efficiently without having to run a for loop(performance hit)
Another point to note is I have to take Max in each such partition. Like in original x array I need element-wise Max from x[0] to x[1] i.e
(From first slice)
op[0,0]=max{x[0,0],x[1,0]}
op[0,1]=max{x[0,1],x[1,1]}
op[0,2]=max{x[0,2],x[1,2]}
(From second slice)
op[1,0]=max{x[2,0],x[3,0],x[4,0]}
op[1,1]=max{x[2,1],x[3,1],x[4,1]}
op[1,2]=max{x[2,2],x[3,2],x[4,2]}
And so on
Can this be done efficiently?