MCPcopy Create free account
hub / github.com/AlayaLab/Hive / decode

Method decode

models/flowsep/diffusers/models/vq_model.py:128–142  ·  view source on GitHub ↗
(
        self, h: torch.FloatTensor, force_not_quantize: bool = False, return_dict: bool = True
    )

Source from the content-addressed store, hash-verified

126 return VQEncoderOutput(latents=h)
127
128 def decode(
129 self, h: torch.FloatTensor, force_not_quantize: bool = False, return_dict: bool = True
130 ) -> Union[DecoderOutput, torch.FloatTensor]:
131 # also go through quantization layer
132 if not force_not_quantize:
133 quant, emb_loss, info = self.quantize(h)
134 else:
135 quant = h
136 quant2 = self.post_quant_conv(quant)
137 dec = self.decoder(quant2, quant if self.config.norm_type == "spatial" else None)
138
139 if not return_dict:
140 return (dec,)
141
142 return DecoderOutput(sample=dec)
143
144 def forward(self, sample: torch.FloatTensor, return_dict: bool = True) -> Union[DecoderOutput, torch.FloatTensor]:
145 r"""

Callers 2

forwardMethod · 0.95
call_qwen3_omniFunction · 0.45

Calls 1

DecoderOutputClass · 0.85

Tested by

no test coverage detected