class_docstr: Generator model.
  
  Made of an encoder-decoder-encoder architecture.
  
  Args:
      input_size (tuple[int, int]): Size of input data.
      latent_vec_size (int): Dimension of latent vector produced between the first encoder-decoder.
      num_input_channels (int): Number of channels in input image.
      n_features (int): Number of feature maps in each convolution layer.
      extra_layers (int, optional): Extra intermediate layers in the encoder/decoder. Defaults to 0.
      add_final_conv_layer (bool, optional): Add a final convolution layer in the decoder. Defaults to True.
class_docstr_tok: ["Generator","model",".","Made","of","an","encoder-decoder-encoder","architecture",".","Args",":","input_size","(","tuple","[","int",",","int","]",")",":","Size","of","input","data",".","latent_vec_size","(","int",")",":","Dimension","of","latent","vector","produced","between","the","first","encoder-decoder",".","num_input_channels","(","int",")",":","Number","of","channels","in","input","image",".","n_features","(","int",")",":","Number","of","feature","maps","in","each","convolution","layer",".","extra_layers","(","int",",","optional",")",":","Extra","intermediate","layers","in","the","encoder\/decoder",".","Defaults","to","0.","add_final_conv_layer","(","bool",",","optional",")",":","Add","a","final","convolution","layer","in","the","decoder",".","Defaults","to","True","."]
docstr: Return generated image and the latent vectors.
docstr_tok: ["Return","generated","image","and","the","latent","vectors","."]
code: def forward(
      self, input_tensor: Tensor
  ) -> tuple[Tensor, Tensor, Tensor]:
      """Return generated image and the latent vectors."""
      latent_i = self.encoder1(input_tensor)
      gen_image = self.decoder(latent_i)
      latent_o = self.encoder2(gen_image)
      return gen_image, latent_i, latent_o
  
imports: from __future__ import annotations
  import math
  import torch
  from torch import Tensor, nn
  from anomalib.data.utils.image import pad_nextpow2
label_desc: Use image node_id 2 for calling the Generator obj's underlying member method code with example usage: obj.forward(input_tensor) and returns: gen_image,  latent_i,  latent_o