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

Method encode

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

Source from the content-addressed store, hash-verified

668
669 @apply_forward_hook
670 def encode(
671 self, x: torch.Tensor, return_dict: bool = True
672 ) -> Union[AutoencoderKLOutput, Tuple[DiagonalGaussianDistribution]]:
673 h = self._encode(x)
674
675 posterior = DiagonalGaussianDistribution(h)
676
677 if not return_dict:
678 return (posterior,)
679 return AutoencoderKLOutput(latent_dist=posterior)
680
681 def _decode(self, zs):
682 dec = [

Callers 6

_batch_encode_vaeFunction · 0.45
_encodeMethod · 0.45
_encodeMethod · 0.45
prepare_mask_latentsMethod · 0.45
prepare_mask_latentsMethod · 0.45

Calls 1

_encodeMethod · 0.95

Tested by

no test coverage detected