MCPcopy Create free account
hub / github.com/huggingface/diffusers / __call__

Method __call__

src/diffusers/models/vae_flax.py:914–927  ·  view source on GitHub ↗
(self, sample, sample_posterior=False, deterministic: bool = True, return_dict: bool = True)

Source from the content-addressed store, hash-verified

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)
916 if sample_posterior:
917 rng = self.make_rng("gaussian")
918 hidden_states = posterior.latent_dist.sample(rng)
919 else:
920 hidden_states = posterior.latent_dist.mode()
921
922 sample = self.decode(hidden_states, return_dict=return_dict).sample
923
924 if not return_dict:
925 return (sample,)
926
927 return FlaxDecoderOutput(sample=sample)

Callers

nothing calls this directly

Calls 5

encodeMethod · 0.95
decodeMethod · 0.95
FlaxDecoderOutputClass · 0.85
sampleMethod · 0.45
modeMethod · 0.45

Tested by

no test coverage detected