MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / decode

Method decode

sat/vae_modules/autoencoder.py:484–499  ·  view source on GitHub ↗
(self, z: torch.Tensor, **decoder_kwargs)

Source from the content-addressed store, hash-verified

482 return z
483
484 def decode(self, z: torch.Tensor, **decoder_kwargs) -> torch.Tensor:
485 if self.max_batch_size is None:
486 dec = self.post_quant_conv(z)
487 dec = self.decoder(dec, **decoder_kwargs)
488 else:
489 N = z.shape[0]
490 bs = self.max_batch_size
491 n_batches = int(math.ceil(N / bs))
492 dec = list()
493 for i_batch in range(n_batches):
494 dec_batch = self.post_quant_conv(z[i_batch * bs : (i_batch + 1) * bs])
495 dec_batch = self.decoder(dec_batch, **decoder_kwargs)
496 dec.append(dec_batch)
497 dec = torch.cat(dec, 0)
498
499 return dec
500
501
502class AutoencoderKL(AutoencodingEngineLegacy):

Callers

nothing calls this directly

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected