class_docstr: Defines the SVGDecoder model.
code: def pretrained_visual_encoder(self, features, hparams):
      # we want the exact hparams used for training this vv
      vae_hparams = trainer_lib.create_hparams(
          hparams.vae_hparam_set,
          hparams.vae_hparams,
          data_dir=hparams.vae_data_dir,
          problem_name=hparams.vae_problem,
      )
  
      # go back to root variable scope
      with tf.variable_scope(
          tf.VariableScope(tf.AUTO_REUSE, ""),
          reuse=tf.AUTO_REUSE,
          auxiliary_name_scope=False,
      ):
          vae = image_vae.ImageVAE(
              vae_hparams,
              mode=self._hparams.mode,
              problem_hparams=vae_hparams.problem_hparams,
          )
          # the real input to vae will be features['rendered_targets']
          vae_features = copy.copy(features)
          vae_features["inputs"] = tf.reshape(
              vae_features["targets_psr"][:, -1, :], [-1, 64, 64, 1]
          )
          vae_features["targets"] = vae_features["inputs"]
          # we want vae to return bottleneck
          vae_features["bottleneck"] = tf.zeros((0, 128))
          sampled_bottleneck, _ = vae(vae_features)
          vae.initialize_from_ckpt(hparams.vae_ckpt_dir)
  
          if tf.executing_eagerly():
              sampled_bottleneck, _ = vae(vae_features)
  
      return sampled_bottleneck
  
imports: import copy
  from magenta.contrib import rnn
  from magenta.models.svg_vae import image_vae
  from magenta.models.svg_vae import svg_decoder_loss
  from tensor2tensor.layers import common_hparams
  from tensor2tensor.layers import common_layers
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import t2t_model
  from tensor2tensor.utils import trainer_lib
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 2 for calling the SVGDecoder obj's underlying member method code with example usage: obj.pretrained_visual_encoder(features, hparams) and returns: sampled_bottleneck