class_docstr: Abstract class for the variational auto-encoder. The abstract method
  for training the network is implemented by subclasses.
class_docstr_tok: ["Abstract","class","for","the","variational","auto-encoder",".","The","abstract","method","for","training","the","network","is","implemented","by","subclasses","."]
code: def set_train(self, is_train=True):
      if is_train:
          self.mode = TRAIN
          self.vae_encoder.train()
          self.vae_decoder.train()
      else:
          self.mode = TEST
          self.vae_encoder.eval()
          self.vae_decoder.eval()
  
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 2 for calling the VAE obj's underlying member method code with example usage: obj.set_train(is_train) without return types