class_docstr: Variational autoencoder module:
  fully-connected and suited for any input shape and type.
  
  The encoder only computes the latent represenations
  and we have then two possible output heads:
  One for the usual output distribution and one for classification.
  The latter is an extension the conventional VAE and incorporates
  a classifier into the network.
  More details can be found in: https://arxiv.org/abs/1809.10635
class_docstr_tok: ["Variational","autoencoder","module",":","fully-connected","and","suited","for","any","input","shape","and","type",".","The","encoder","only","computes","the","latent","represenations","and","we","have","then","two","possible","output","heads",":","One","for","the","usual","output","distribution","and","one","for","classification",".","The","latter","is","an","extension","the","conventional","VAE","and","incorporates","a","classifier","into","the","network",".","More","details","can","be","found","in",":","https",":","\/\/arxiv.org\/abs\/1809.10635"]
docstr: Forward.
docstr_tok: ["Forward","."]
code: def forward(self, x):
      """
      Forward.
      """
      represntations = self.encoder(x)
      mean, logvar = self.calc_mean(represntations), self.calc_logvar(
          represntations
      )
      z = self.sampling(mean, logvar)
      return self.decoder(z), mean, logvar
  
imports: from abc import abstractmethod
  from typing import Union
  from matplotlib import transforms
  import torch
  import torch.nn
  from torchvision import transforms
  from avalanche.models.utils import MLP, Flatten
  from avalanche.models.base_model import BaseModel
label_desc: Use image node_id 5 for calling the MlpVAE obj's underlying member method code with example usage: obj.forward(x) and returns: self,  mean,  logvar