def forward(self, x: torch.Tensor, image_size: tuple[int, int] | torch.Size) -> torch.Tensor:
        """Forward pass through the autoencoder.

        Args:
            x (torch.Tensor): Input tensor of shape ``(N, C, H, W)``.
            image_size (tuple[int, int] | torch.Size): Target output size ``(H, W)``.

        Returns:
            torch.Tensor: Reconstructed features of shape ``(N, out_channels, H', W')``,
                where ``H'`` and ``W'`` are determined by the decoder architecture and
                padding settings.
        """
        x = imagenet_norm_batch(x)
        x = self.encoder(x)
        return self.decoder(x, image_size)
Forward pass through the autoencoder.

        Args:
            x (torch.Tensor): Input tensor of shape ``(N, C, H, W)``.
            image_size (tuple[int, int] | torch.Size): Target output size ``(H, W)``.

        Returns:
            torch.Tensor: Reconstructed features of shape ``(N, out_channels, H', W')``,
                where ``H'`` and ``W'`` are determined by the decoder architecture and
                padding settings.
        
src/anomalib/models/image/efficient_ad/torch_model.py