tensorplay.nn.functional.grid_sample
- tensorplay.nn.functional.grid_sample(input: TensorBase, grid: TensorBase, mode: str = 'bilinear', padding_mode: str = 'zeros', align_corners=None) TensorBase[source]
Compute grid sample.
Given an
inputand a flow-fieldgrid, computes theoutputusinginputvalues and pixel locations fromgrid. Currently, only spatial (4-D) and volumetric (5-D)inputare supported.- Parameters:
input (Tensor) – input of shape (4-D case) or (5-D case)
grid (Tensor) – flow-field of shape (4-D case) or (5-D case)
mode (str) –
'bilinear'|'nearest'|'bicubic'. Default:'bilinear'padding_mode (str) –
'zeros'|'border'|'reflection'. Default:'zeros'align_corners (bool, optional) – extrema treatment, default
False.
Dispatches to the native grid_sampler_2d / grid_sampler_3d kernels both
inputandgrid.

