torchsig.models.spectrogram_models.detr.criterion.point_sample

torchsig.models.spectrogram_models.detr.criterion.point_sample(input, point_coords, **kwargs)[source]

A wrapper around :function:`torch.nn.functional.grid_sample` to support 3D point_coords tensors. Unlike :function:`torch.nn.functional.grid_sample` it assumes point_coords to lie inside [0, 1] x [0, 1] square. :param input: A tensor of shape (N, C, H, W) that contains features map on a H x W grid. :type input: Tensor :param point_coords: A tensor of shape (N, P, 2) or (N, Hgrid, Wgrid, 2) that contains :type point_coords: Tensor :param [0: :param 1] x [0: :param 1] normalized point coordinates.:

Returns:

A tensor of shape (N, C, P) or (N, C, Hgrid, Wgrid) that contains

features for points in point_coords. The features are obtained via bilinear interplation from input the same way as :function:`torch.nn.functional.grid_sample`.

Return type:

output (Tensor)