MCPcopy Create free account
hub / github.com/tdrussell/diffusion-pipe / vae_encode

Function vae_encode

models/cosmos.py:115–120  ·  view source on GitHub ↗
(tensor, vae)

Source from the content-addressed store, hash-verified

113
114
115def vae_encode(tensor, vae):
116 # tensor values already in range [-1, 1] here
117 p = next(vae.encoder.parameters())
118 # TODO: the official code would call vae.encode_image() when it detects frames=1.
119 # Should we use the image encoder (separate model)?
120 return vae.encode(tensor.to(p.device, p.dtype))
121
122
123def dataset_config_validation(config):

Callers 1

fnMethod · 0.70

Calls 2

encodeMethod · 0.45
toMethod · 0.45

Tested by

no test coverage detected