class_docstr: Decoder part of the VAE. Reverses Encoder.
  
  :param shape: Shape of output: (channels, height, width).
  :param nhid: Dimension of input.
class_docstr_tok: ["Decoder","part","of","the","VAE",".","Reverses","Encoder",".",":","param","shape",":","Shape","of","output",":","(","channels",",","height",",","width",")",".",":","param","nhid",":","Dimension","of","input","."]
code: def forward(self, z, y=None):
      if y is None:
          return self.invTrans(self.decode(z).view(-1, *self.shape))
      else:
          return self.invTrans(
              self.decode(torch.cat((z, y), dim=1)).view(
                  -1, *self.shape
              )
          )
  
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 2 for calling the VAEMLPDecoder obj's underlying member method code with example usage: obj.forward(z, y) and returns: self, self