Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/diffusers/models/autoencoders/autoencoder_asym_kl.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def forward(
z = posterior.sample(generator=generator)
else:
z = posterior.mode()
dec = self.decode(z, sample, mask).sample
dec = self.decode(z, generator, sample, mask).sample
Copy link
Member

Choose a reason for hiding this comment

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

Tend to agree with @tolgacangoz's comments here. It's not used in the decode() function. Similar to AutoencoderKL. It's used in the forward():

z = posterior.sample(generator=generator)

Copy link
Member

Choose a reason for hiding this comment

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

I don't think there's a stochastic component in the decode() function in the first place. So, I further think there's no need to have generator in here too:

def decode(self, z: torch.Tensor, return_dict: bool = True, generator=None) -> Union[DecoderOutput, torch.Tensor]:

@yiyixuxu WDYT here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

@sayakpaul I had the same questions, but their explanation makes sense I think


if not return_dict:
return (dec,)
Expand Down