def prepare_seam_mask(self) -> torch.Tensor:
        """Prepare boolean mask of regions around the part where tiles seam in ensemble.

        Returns:
            torch.Tensor: Representation of boolean mask where filtered seams should be used.
        """
        img_h, img_w = self.tiler.image_size
        stride_h, stride_w = self.tiler.stride_h, self.tiler.stride_w

        mask = torch.zeros(img_h, img_w, dtype=torch.bool)

        # prepare mask strip on vertical seams
        curr_w = stride_w
        while curr_w < img_w:
            start_i = curr_w - self.width_offset
            end_i = curr_w + self.width_offset
            mask[:, start_i:end_i] = 1
            curr_w += stride_w

        # prepare mask strip on horizontal seams
        curr_h = stride_h
        while curr_h < img_h:
            start_i = curr_h - self.height_offset
            end_i = curr_h + self.height_offset
            mask[start_i:end_i, :] = True
            curr_h += stride_h

        return mask
Prepare boolean mask of regions around the part where tiles seam in ensemble.

        Returns:
            torch.Tensor: Representation of boolean mask where filtered seams should be used.
        
src/anomalib/pipelines/tiled_ensemble/components/smoothing.py