Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove unnecessary transpositions #488

Merged
merged 2 commits into from
Jun 28, 2024
Merged

Conversation

charSLee013
Copy link
Contributor

@charSLee013 charSLee013 commented Jun 27, 2024

Content:

This PR addresses the issue of redundant transposition operations:

  1. The original DVAE forward method included a transpose operation:
  dec_out = self.out_conv(
      self.decoder(
          input=vq_feats.transpose_(1, 2), <- here
      ).transpose_(1, 2),   <- and here
  )
  1. This transpose was then repeated in the DVAEDecoder forward method:
def forward(self, input: torch.Tensor, conditioning=None) -> torch.Tensor:
    # B, T, C
    x = input.transpose_(1, 2) <- again
    ...
    return x.transpose_(1, 2) <-  also extraneous transpose

ChatTTS/model/dvae.py Outdated Show resolved Hide resolved
@charSLee013 charSLee013 requested a review from fumiama June 28, 2024 09:59
@fumiama fumiama merged commit e04ec2f into 2noise:main Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants