def _add_vector(self, transform_vector):
        """Add a vector transform to the base latent and returns the resulting image."""
        base_latent = self.latent.detach().requires_grad_()
        trans_latent = base_latent + transform_vector
        if self.quantize:
            z_q, *_ = self.vqgan.quantize(trans_latent)
        else:
            z_q = trans_latent
        return self.vqgan.decode(z_q)
Add a vector transform to the base latent and returns the resulting image.
dpkd/transformers/examples/research_projects/vqgan-clip/VQGAN_CLIP.py