MCPcopy Create free account
hub / github.com/apache/tvm / _compute_source_index

Function _compute_source_index

python/tvm/topi/testing/grid_sample_python.py:93–107  ·  view source on GitHub ↗
(b, h, w)

Source from the content-addressed store, hash-verified

91 return x
92
93 def _compute_source_index(b, h, w):
94 y = grid[b, 1, h, w]
95 x = grid[b, 0, h, w]
96 y, x = _unnormalize(y, x)
97
98 if padding_mode == "reflection":
99 y = _reflect_coordinates(y, in_height)
100 x = _reflect_coordinates(x, in_width)
101 y = _clip_coordinates(y, in_height)
102 x = _clip_coordinates(x, in_width)
103 elif padding_mode == "border":
104 y = _clip_coordinates(y, in_height)
105 x = _clip_coordinates(x, in_width)
106
107 return (y, x)
108
109 def _nearest_sample():
110 for _b in range(batch):

Callers 3

_nearest_sampleFunction · 0.70
_bilinear_sampleFunction · 0.70
_triilinear_sampleFunction · 0.70

Calls 3

_unnormalizeFunction · 0.70
_reflect_coordinatesFunction · 0.70
_clip_coordinatesFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…