euiia commited on
Commit
f06d030
·
verified ·
1 Parent(s): b7e85da

Update deformes4D_engine.py

Browse files
Files changed (1) hide show
  1. deformes4D_engine.py +17 -2
deformes4D_engine.py CHANGED
@@ -169,9 +169,24 @@ class Deformes4DEngine:
169
 
170
  latent_fragments.append(latents_video)
171
 
172
- logger.info("--- CONCATENANDO TODOS OS FRAGMENTOS LATENTES ---")
173
- tensors_para_concatenar = [frag.to(self.device) for frag in latent_fragments]
 
 
 
 
 
 
 
 
 
 
174
  processed_latents = torch.cat(tensors_para_concatenar, dim=2)
 
 
 
 
 
175
  # [CORREÇÃO 2] Referência correta da variável no log
176
  logger.info(f"Concatenação concluída. Shape final do tensor latente: {processed_latents.shape}")
177
 
 
169
 
170
  latent_fragments.append(latents_video)
171
 
172
+
173
+ logger.info("--- CONCATENANDO nem TODOS OS FRAGMENTOS LATENTES ---")
174
+ tensors_para_concatenar = []
175
+ for idx, tensor_frag in enumerate(latent_fragments):
176
+ # Move cada tensor para o dispositivo de destino antes de adicioná-lo à lista.
177
+ target_device = self.device
178
+ tensor_on_target_device = tensor_frag.to(target_device)
179
+ if idx < len(latent_fragments) - 1:
180
+ tensors_para_concatenar.append(tensor_on_target_device[:, :, :-1, :, :])
181
+ else:
182
+ tensors_para_concatenar.append(tensor_on_target_device)
183
+
184
  processed_latents = torch.cat(tensors_para_concatenar, dim=2)
185
+ logger.info(f"Concatenação concluída. Shape final do tensor latente: {final_concatenated_latents.shape}")
186
+
187
+
188
+
189
+
190
  # [CORREÇÃO 2] Referência correta da variável no log
191
  logger.info(f"Concatenação concluída. Shape final do tensor latente: {processed_latents.shape}")
192