Solved by stante in post #2 
              
              
                Hello, 
I am not sure if I completely understood your question because more or less you wrote the solution. I don’t know the size of your gen_imgs. But for the sake of simplicity assume I assume the following: 
# Assume a batch dimension of 128, 3 channels and 32 pixel width and height
gen_imgs = to…