How can we make square image from  given N tiles that is perfect square . Say N=36
each tile is 3 * H * W dimensions
N=25
Ng=5
for i in range(N//Ng):
            imgs_tmp=[imgs[i*Ng+j] for j in range(Ng) if i*Ng+j <= len(imgs)]
          
            combine_tensor_list.append(torch.cat(imgs_tmp,0))
        
    
    img=torch.cat(combine_tensor_list,0).view(3,Ng*imgs[0].size(1),Ng*imgs[0].size(2))

I am using above logic but gives a very weird image. dsnt looks to be right one wrt to view of single tile image.