Spaces:
Runtime error
Runtime error
Update deformes4D_engine.py
Browse files- deformes4D_engine.py +17 -2
deformes4D_engine.py
CHANGED
|
@@ -169,9 +169,24 @@ class Deformes4DEngine:
|
|
| 169 |
|
| 170 |
latent_fragments.append(latents_video)
|
| 171 |
|
| 172 |
-
|
| 173 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
|