MCPcopy Create free account
hub / github.com/OpenGVLab/DragGAN / grid_sample

Function grid_sample

draggan/stylegan2/torch_utils/ops/grid_sample_gradfix.py:27–30  ·  view source on GitHub ↗
(input, grid)

Source from the content-addressed store, hash-verified

25#----------------------------------------------------------------------------
26
27def grid_sample(input, grid):
28 if _should_use_custom_op():
29 return _GridSample2dForward.apply(input, grid)
30 return torch.nn.functional.grid_sample(input=input, grid=grid, mode='bilinear', padding_mode='zeros', align_corners=False)
31
32#----------------------------------------------------------------------------
33

Callers

nothing calls this directly

Calls 1

_should_use_custom_opFunction · 0.70

Tested by

no test coverage detected