Skip to content

Commit 6e539e8

Browse files
realsamapatrickvonplatenanton-l
authored andcommitted
type hints: models/vae.py (#346)
* type hints: models/vae.py * modify typings in vae.py Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com> Co-authored-by: Anton Lozhkov <anton@huggingface.co>
1 parent 226a8b7 commit 6e539e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/diffusers/models/vae.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ def __init__(
487487
self.quant_conv = torch.nn.Conv2d(2 * latent_channels, 2 * latent_channels, 1)
488488
self.post_quant_conv = torch.nn.Conv2d(latent_channels, latent_channels, 1)
489489

490-
def encode(self, x, return_dict: bool = True):
490+
def encode(self, x: torch.FloatTensor, return_dict: bool = True) -> AutoencoderKLOutput:
491491
h = self.encoder(x)
492492
moments = self.quant_conv(h)
493493
posterior = DiagonalGaussianDistribution(moments)

0 commit comments

Comments
 (0)