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

Method decode

models/flowsep/diffusers/models/autoencoder_kl.py:186–196  ·  view source on GitHub ↗
(self, z: torch.FloatTensor, return_dict: bool = True)

Source from the content-addressed store, hash-verified

184
185 @apply_forward_hook
186 def decode(self, z: torch.FloatTensor, return_dict: bool = True) -> Union[DecoderOutput, torch.FloatTensor]:
187 if self.use_slicing and z.shape[0] > 1:
188 decoded_slices = [self._decode(z_slice).sample for z_slice in z.split(1)]
189 decoded = torch.cat(decoded_slices)
190 else:
191 decoded = self._decode(z).sample
192
193 if not return_dict:
194 return (decoded,)
195
196 return DecoderOutput(sample=decoded)
197
198 def blend_v(self, a, b, blend_extent):
199 blend_extent = min(a.shape[2], b.shape[2], blend_extent)

Callers 1

forwardMethod · 0.95

Calls 2

_decodeMethod · 0.95
DecoderOutputClass · 0.85

Tested by

no test coverage detected