MCPcopy Create free account
hub / github.com/ml-explore/mlx-examples / __call__

Method __call__

stable_diffusion/stable_diffusion/vae.py:269–274  ·  view source on GitHub ↗
(self, x, key=None)

Source from the content-addressed store, hash-verified

267 return mean, logvar
268
269 def __call__(self, x, key=None):
270 mean, logvar = self.encode(x)
271 z = mx.random.normal(mean.shape, key=key) * mx.exp(0.5 * logvar) + mean
272 x_hat = self.decode(z)
273
274 return dict(x_hat=x_hat, z=z, mean=mean, logvar=logvar)

Callers

nothing calls this directly

Calls 2

encodeMethod · 0.95
decodeMethod · 0.95

Tested by

no test coverage detected