fix: transpose VAE latent from [B,C,T] to [B,T,C] before generator

VAE encoder returns channels-first [B, latent_dim, T]; the generator
expects time-first [B, T, latent_dim] (same convention as decode which
already does .transpose(1,2)). Fixes normalize() size mismatch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-05 22:08:00 +02:00
parent 6b9adf0816
commit 43f732f904
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -139,7 +139,8 @@ def extract_audio_latent(audio: torch.Tensor, feature_utils, device, dtype) -> t
"""
audio_b = audio.unsqueeze(0).to(device, dtype) # [1, L]
dist = feature_utils.encode_audio(audio_b)
return dist.mode().clone().cpu() # [1, seq_len, latent_dim]
# VAE outputs [B, latent_dim, T]; generator expects [B, T, latent_dim]
return dist.mode().clone().transpose(1, 2).cpu() # [1, seq_len, latent_dim]
# ---------------------------------------------------------------------------