def normalize_features(self, features: torch.Tensor) -> torch.Tensor:
        """Normalize extracted features from both scales.

        For each scale:
        1. Apply layer normalization
        2. Reshape features to spatial format
        3. Append to list of normalized features

        Args:
            features (torch.Tensor): Tuple of features from both extractors

        Returns:
            torch.Tensor: List of normalized feature tensors with shapes:
                ``[(B, 768, H/16, W/16), (B, 384, H/32, W/32)]``
        """
        normalized_features = []
        for i, extractor in enumerate([self.extractor1, self.extractor2]):
            batch, _, channels = features[i].shape
            scale_factor = self.scale_factors[i]

            x = extractor.norm(features[i].contiguous())
            x = x.permute(0, 2, 1)
            x = x.reshape(batch, channels, self.input_size // scale_factor, self.input_size // scale_factor)
            normalized_features.append(x)

        return normalized_features
Normalize extracted features from both scales.

        For each scale:
        1. Apply layer normalization
        2. Reshape features to spatial format
        3. Append to list of normalized features

        Args:
            features (torch.Tensor): Tuple of features from both extractors

        Returns:
            torch.Tensor: List of normalized feature tensors with shapes:
                ``[(B, 768, H/16, W/16), (B, 384, H/32, W/32)]``
        
src/anomalib/models/image/uflow/feature_extraction.py