def get_scale(self, input_size: tuple[int, int] | torch.Size) -> torch.Size:
        """Get the scale of the feature maps.

        Args:
            input_size (tuple[int, int] | torch.Size): Input image dimensions
                (height, width).

        Returns:
            torch.Size: Feature map dimensions.

        Example:
            >>> model = CfaModel(...)
            >>> scale = model.get_scale((256, 256))
        """
        feature_map_metadata = dryrun_find_featuremap_dims(
            feature_extractor=self.feature_extractor,
            input_size=input_size,
            layers=get_return_nodes(self.backbone),
        )
        # Scale is to get the largest feature map dimensions of different layers
        # of the feature extractor. In a typical feature extractor, the first
        # layer has the highest resolution.
        resolution = next(iter(feature_map_metadata.values()))["resolution"]
        if isinstance(resolution, int):
            scale = (resolution,) * 2
        elif isinstance(resolution, tuple):
            scale = resolution
        else:
            msg = f"Unknown type {type(resolution)} for `resolution`. Expected types are either int or tuple[int, int]."
            raise TypeError(msg)
        return scale
Get the scale of the feature maps.

        Args:
            input_size (tuple[int, int] | torch.Size): Input image dimensions
                (height, width).

        Returns:
            torch.Size: Feature map dimensions.

        Example:
            >>> model = CfaModel(...)
            >>> scale = model.get_scale((256, 256))
        
src/anomalib/models/image/cfa/torch_model.py