class_docstr: Reverse Distillation Model.
  
  To reproduce results in the paper, use torchvision model for the encoder:
      self.encoder = torchvision.models.wide_resnet50_2(pretrained=True)
  
  Args:
      backbone (str): Name of the backbone used for encoder and decoder
      input_size (tuple[int, int]): Size of input image
      layers (list[str]): Name of layers from which the features are extracted.
      anomaly_map_mode (str): Mode used to generate anomaly map. Options are between ``multiply`` and ``add``.
      pre_trained (bool, optional): Boolean to check whether to use a pre_trained backbone.
docstr: Forward-pass images to the network.
  
  During the training mode the model extracts features from encoder and decoder networks.
  During evaluation mode, it returns the predicted anomaly map.
  
  Args:
      images (Tensor): Batch of images
  
  Returns:
      Tensor | list[Tensor] | tuple[list[Tensor]]: Encoder and decoder features in training mode,
          else anomaly maps.
docstr_tok: ["Forward-pass","images","to","the","network",".","During","the","training","mode","the","model","extracts","features","from","encoder","and","decoder","networks",".","During","evaluation","mode",",","it","returns","the","predicted","anomaly","map",".","Args",":","images","(","Tensor",")",":","Batch","of","images","Returns",":","Tensor","|","list","[","Tensor","]","|","tuple","[","list","[","Tensor","]","]",":","Encoder","and","decoder","features","in","training","mode",",","else","anomaly","maps","."]
code: def forward(
      self, images: Tensor
  ) -> Tensor | list[Tensor] | tuple[list[Tensor]]:
      """Forward-pass images to the network.
  
      During the training mode the model extracts features from encoder and decoder networks.
      During evaluation mode, it returns the predicted anomaly map.
  
      Args:
          images (Tensor): Batch of images
  
      Returns:
          Tensor | list[Tensor] | tuple[list[Tensor]]: Encoder and decoder features in training mode,
              else anomaly maps.
      """
      self.encoder.eval()
  
      if self.tiler:
          images = self.tiler.tile(images)
      encoder_features = self.encoder(images)
      encoder_features = list(encoder_features.values())
      decoder_features = self.decoder(self.bottleneck(encoder_features))
  
      if self.tiler:
          for i, features in enumerate(encoder_features):
              encoder_features[i] = self.tiler.untile(features)
          for i, features in enumerate(decoder_features):
              decoder_features[i] = self.tiler.untile(features)
  
      if self.training:
          output = encoder_features, decoder_features
      else:
          output = self.anomaly_map_generator(
              encoder_features, decoder_features
          )
  
      return output
  
file_path: anomalib/src/anomalib/models/reverse_distillation/torch_model.py
imports: from __future__ import annotations
  from torch import Tensor, nn
  from anomalib.models.components import FeatureExtractor
  from anomalib.models.reverse_distillation.anomaly_map import AnomalyMapGenerator
  from anomalib.models.reverse_distillation.components import get_bottleneck_layer, get_decoder
  from anomalib.pre_processing import Tiler
  from .anomaly_map import AnomalyMapGenerationMode
label_desc: Use image node_id 2 for calling the ReverseDistillationModel obj's underlying member method code with example usage: obj.forward(images) and returns: output