MCPcopy Index your code
hub / github.com/huggingface/diffusers / decode

Method decode

src/diffusers/models/vae_flax.py:900–912  ·  view source on GitHub ↗
(self, latents, deterministic: bool = True, return_dict: bool = True)

Source from the content-addressed store, hash-verified

898 return FlaxAutoencoderKLOutput(latent_dist=posterior)
899
900 def decode(self, latents, deterministic: bool = True, return_dict: bool = True):
901 if latents.shape[-1] != self.config.latent_channels:
902 latents = jnp.transpose(latents, (0, 2, 3, 1))
903
904 hidden_states = self.post_quant_conv(latents)
905 hidden_states = self.decoder(hidden_states, deterministic=deterministic)
906
907 hidden_states = jnp.transpose(hidden_states, (0, 3, 1, 2))
908
909 if not return_dict:
910 return (hidden_states,)
911
912 return FlaxDecoderOutput(sample=hidden_states)
913
914 def __call__(self, sample, sample_posterior=False, deterministic: bool = True, return_dict: bool = True):
915 posterior = self.encode(sample, deterministic=deterministic, return_dict=return_dict)

Callers 15

__call__Method · 0.95
runMethod · 0.45
__call__Method · 0.45
__call__Method · 0.45
__call__Method · 0.45
__call__Method · 0.45
__call__Method · 0.45
_enhance_promptMethod · 0.45
__call__Method · 0.45
__call__Method · 0.45
__call__Method · 0.45
__call__Method · 0.45

Calls 2

FlaxDecoderOutputClass · 0.85
transposeMethod · 0.80

Tested by

no test coverage detected