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

Method decode

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

Source from the content-addressed store, hash-verified

467 return z
468
469 def decode(self, z: torch.Tensor, **decoder_kwargs) -> torch.Tensor:
470 if self.max_batch_size is None:
471 dec = self.post_quant_conv(z)
472 dec = self.decoder(dec, **decoder_kwargs)
473 else:
474 N = z.shape[0]
475 bs = self.max_batch_size
476 n_batches = int(math.ceil(N / bs))
477 dec = list()
478 for i_batch in range(n_batches):
479 dec_batch = self.post_quant_conv(z[i_batch * bs : (i_batch + 1) * bs])
480 dec_batch = self.decoder(dec_batch, **decoder_kwargs)
481 dec.append(dec_batch)
482 dec = torch.cat(dec, 0)
483
484 return dec
485
486
487class IdentityFirstStage(AbstractAutoencoder):

Callers

nothing calls this directly

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected