class_docstr: Implementation of VAE using Pyro. Only the model and the guide specification
  is needed to run the optimizer (the objective function does not need to be
  specified as in the PyTorch implementation).
class_docstr_tok: ["Implementation","of","VAE","using","Pyro",".","Only","the","model","and","the","guide","specification","is","needed","to","run","the","optimizer","(","the","objective","function","does","not","need","to","be","specified","as","in","the","PyTorch","implementation",")","."]
code: def guide(self, data):
      encoder = pyro.module("encoder", self.vae_encoder)
      with pyro.plate("data", data.size(0)):
          z_mean, z_var = encoder.forward(data)
          pyro.sample(
              "latent", Normal(z_mean, z_var.sqrt()).to_event(1)
          )
  
imports: import argparse
  import itertools
  import os
  from abc import ABCMeta, abstractmethod
  import torch
  import torch.nn
  from torch.nn import functional
  from torchvision.utils import save_image
  from utils.mnist_cached import DATA_DIR, RESULTS_DIR
  import pyro
  from pyro.contrib.examples import util
  from pyro.distributions import Bernoulli, Normal
  from pyro.infer import SVI, JitTrace_ELBO, Trace_ELBO
  from pyro.optim import Adam
label_desc: Use image node_id 3 for calling the PyroVAEImpl obj's underlying member method code with example usage: obj.guide(data) without return types