MCPcopy
hub / github.com/NVIDIA/TensorRT-LLM / encode

Method encode

examples/models/contrib/stdit/vae.py:576–584  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

574 return latent_size
575
576 def encode(self, x):
577 time_padding = x.shape[2] % self.time_downsample_factor
578 if time_padding != 0:
579 time_padding = self.time_downsample_factor - time_padding
580 x = pad_at_dim(x, (time_padding, 0), dim=2)
581 encoded_feature = self.encoder(x)
582 moments = self.quant_conv(encoded_feature).to(x.dtype)
583 posterior = DiagonalGaussianDistribution(moments)
584 return posterior
585
586 def decode(self, z, num_frames=None):
587 time_padding = num_frames % self.time_downsample_factor

Callers 15

forwardMethod · 0.95
parse_inputFunction · 0.45
parse_inputFunction · 0.45
__call__Method · 0.45
check_valid_lengthMethod · 0.45
_prepare_inputsFunction · 0.45
generate_llm_outputsFunction · 0.45
text_to_tokenFunction · 0.45
_load_triton_plugin_libFunction · 0.45
stream_resultsMethod · 0.45
tok_encodeMethod · 0.45

Calls 3

pad_at_dimFunction · 0.85
toMethod · 0.45

Tested by

no test coverage detected