MCPcopy Create free account
hub / github.com/Francis-Rings/FlashPortrait / encode

Method encode

wan/models/wan_vae.py:810–819  ·  view source on GitHub ↗
(
        self, x: torch.Tensor, return_dict: bool = True
    )

Source from the content-addressed store, hash-verified

808
809 @apply_forward_hook
810 def encode(
811 self, x: torch.Tensor, return_dict: bool = True
812 ) -> Union[AutoencoderKLOutput, Tuple[DiagonalGaussianDistribution]]:
813 h = self._encode(x)
814
815 posterior = DiagonalGaussianDistribution(h)
816
817 if not return_dict:
818 return (posterior,)
819 return AutoencoderKLOutput(latent_dist=posterior)
820
821 def _decode(self, zs):
822 dec = [

Callers

nothing calls this directly

Calls 1

_encodeMethod · 0.95

Tested by

no test coverage detected