Solved by Nikronic in post #4 
              
              
                So based on your explanation, you need all latent vectors of the dataset to be able to calculate the for loop. Actually, it may be tricky, because of memory issues because you need to pass all the dataset containing a class such as cat. 
There is point here. the encoder generates latent_vector, so i…