patch_denoise.gpu.dataloader.sliding_sum_nd#
- patch_denoise.gpu.dataloader.sliding_sum_nd(data, patch_shape, patch_overlap)[source]#
Compute a sliding sum across all dimensions using sequential 1D convolutions.
- Parameters:
- Returns:
results of the sliding sum, with the same grid shape as the output of patchify_tensor, but with the values being the sum of the corresponding patches in the input data.
- Return type:
torch.Tensor
Notes
Here a convolution-based approach is used to efficiently compute the sliding sum over each dimension (problem is separable). This is (significantly) more memory efficient than working on the patchified tensor.