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

Remove duplicate checks for len(generator) != batch_size when generator is a list #10134

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

a-r-r-o-w
Copy link
Member

Removes unnecessary duplicate checks on length of generator, as it is already checked in a previous condition

@a-r-r-o-w a-r-r-o-w requested a review from yiyixuxu December 5, 2024 20:36
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@@ -662,12 +662,6 @@ def prepare_latents(
self.vae.to(dtype=torch.float32)

if isinstance(generator, list):
if len(generator) != batch_size:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh where is it checked?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few lines above

image

@a-r-r-o-w a-r-r-o-w changed the title Remove duplicate len(generator) == batch_size checks Remove duplicate checks for len(generator) != batch_size when generator is a list Dec 5, 2024
Copy link
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@hlky hlky merged commit 18f9b99 into main Dec 6, 2024
18 checks passed
sayakpaul pushed a commit that referenced this pull request Dec 23, 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.

4 participants