def forward(self, input_tensor: torch.Tensor) -> torch.Tensor:
        """Forward pass through encoder network.

        Args:
            input_tensor (torch.Tensor): Input tensor of shape
                ``(batch_size, channels, height, width)``

        Returns:
            torch.Tensor: Latent vector tensor
        """
        output = self.input_layers(input_tensor)
        output = self.extra_layers(output)
        output = self.pyramid_features(output)
        if self.final_conv_layer is not None:
            output = self.final_conv_layer(output)

        return output
Forward pass through encoder network.

        Args:
            input_tensor (torch.Tensor): Input tensor of shape
                ``(batch_size, channels, height, width)``

        Returns:
            torch.Tensor: Latent vector tensor
        
src/anomalib/models/image/ganomaly/torch_model.py