PatchDataset#

class patch_denoise.gpu.dataloader.PatchDataset(input_data: Tensor, *, patch_shape: tuple[int, ...], patch_overlap: tuple[int, ...], noise_map=None, mask: Tensor | NDArray | None = None, mask_threshold=50)[source]#

Bases: object

GPU-resident collection of patches, batch-gathered from input_data.

input_data is expected to already live on the target device: patches are then extracted with a single vectorized advanced-index gather per batch (see get_batch()), with no host-device transfer or per-item Python loop in the hot path.

Methods

__init__

get_batch

Gather patches [start, stop) and their top-left corner indices.

get_batch(start: int, stop: int)[source]#

Gather patches [start, stop) and their top-left corner indices.

A single vectorized advanced-index gather over the (already GPU-resident) strided patch view – no per-patch Python loop, no host-device copy.