Sampling
torchlinops.linops.Sampling
Bases: NamedLinop
Sample a tensor at some specified integer locations.
Source code in src/torchlinops/linops/sampling.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | |
__init__
__init__(
idx: tuple[Integer[Tensor, ...], ...],
input_size: tuple[int, ...],
output_shape: Optional[Shape] = None,
input_shape: Optional[Shape] = None,
batch_shape: Optional[Shape] = None,
)
| PARAMETER | DESCRIPTION |
|---|---|
idx
|
tuple of of D tensors, each of shape [M...]
One index for each "sampled" axis of the input tensor
Use |
input_size
|
Actual shape of the input interpolated tensor, without the batch dimensions. |
output_shape
|
Named dimensions for the output.
TYPE:
|
input_shape
|
Named dimensions for the input.
TYPE:
|
batch_shape
|
Named batch dimensions.
TYPE:
|
Notes
Sampling: (B..., N...) -> (B..., M...)
Source code in src/torchlinops/linops/sampling.py
from_mask
classmethod
from_stacked_idx
classmethod
Alternative constructor for index in [M... D] form
torchlinops.linops.BreakpointLinop
Bases: NamedLinop
Debugging identity operator that drops into pdb on forward/adjoint.
Useful for inspecting intermediate tensor values inside a Chain.