float_grid_sample_2d_ref

Function float_grid_sample_2d_ref 

Source
pub fn float_grid_sample_2d_ref<B: Backend>(
    tensor: FloatTensor<B>,
    grid: FloatTensor<B>,
    options: GridSampleOptions,
) -> FloatTensor<B>
Expand description

Reference implementation of grid_sample_2d that supports all options.

§Arguments

  • tensor - The tensor being sampled from, shape (N, C, H_in, W_in)
  • grid - A tensor of locations, with shape (N, H_out, W_out, 2). Values are [-1, 1]. A [x = -1, y = -1] means top-left, and [x = 1, y = 1] means bottom-right
  • options - Grid sampling options

§Returns

A tensor with shape (N, C, H_out, W_out)