in models/generator.py [0:0]
def process_latents(self, z):
# output should be list with separate latent code for each conditional layer in the model
# should be a list
if isinstance(z, list): # latents already in proper format
pass
elif z.ndim == 2: # standard training, shape [B, ch]
z = [z] * (self.n_layers + 4)
elif z.ndim == 3: # latent optimization, shape [B, n_latent_layers, ch]
n_latents = z.shape[1]
z = [z[:, i] for i in range(n_latents)]
return z