(self, z: torch.FloatTensor, return_dict: bool = True)
| 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) |
no test coverage detected