MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / encode

Method encode

diffusers/src/diffusers/models/autoencoders/vq_model.py:130–137  ·  view source on GitHub ↗
(self, x: torch.Tensor, return_dict: bool = True)

Source from the content-addressed store, hash-verified

128
129 @apply_forward_hook
130 def encode(self, x: torch.Tensor, return_dict: bool = True) -> VQEncoderOutput:
131 h = self.encoder(x)
132 h = self.quant_conv(h)
133
134 if not return_dict:
135 return (h,)
136
137 return VQEncoderOutput(latents=h)
138
139 @apply_forward_hook
140 def decode(

Callers 1

forwardMethod · 0.95

Calls 1

VQEncoderOutputClass · 0.70

Tested by

no test coverage detected