def tile(self, image: Tensor, use_random_tiling: bool = False) -> Tensor:
        """Tiles an input image to either overlapping or non-overlapping patches.

        Args:
            image (Tensor): Input images.
            use_random_tiling (bool): Random tiling, which is part of original tiler but is unused here.

        Returns:
            Tensor: Tiles generated from images.
                Returned shape: [num_h, num_w, batch, channel, tile_height, tile_width].
        """
        # tiles are returned in order [tile_count * batch, channels, tile_height, tile_width]
        combined_tiles = super().tile(image, use_random_tiling)

        # rearrange to [num_h, num_w, batch, channel, tile_height, tile_width]
        tiles = combined_tiles.contiguous().view(
            self.batch_size,
            self.num_patches_h,
            self.num_patches_w,
            self.num_channels,
            self.tile_size_h,
            self.tile_size_w,
        )
        tiles = tiles.permute(1, 2, 0, 3, 4, 5)

        return tiles  # noqa: RET504
Tiles an input image to either overlapping or non-overlapping patches.

        Args:
            image (Tensor): Input images.
            use_random_tiling (bool): Random tiling, which is part of original tiler but is unused here.

        Returns:
            Tensor: Tiles generated from images.
                Returned shape: [num_h, num_w, batch, channel, tile_height, tile_width].
        
src/anomalib/pipelines/tiled_ensemble/components/utils/ensemble_tiling.py