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

Function _bilinear_sample

python/tvm/topi/testing/grid_sample_python.py:121–137  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

119 out[_b, _c, _h, _w] = _get_pixel(_b, _c, new_y, new_x)
120
121 def _bilinear_sample():
122 for _b in range(batch):
123 for _c in range(channel):
124 for _h in range(out_height):
125 for _w in range(out_width):
126 y, x = _compute_source_index(_b, _h, _w)
127 y0 = math.floor(y)
128 x0 = math.floor(x)
129 y1 = y0 + 1
130 x1 = x0 + 1
131
132 out[_b, _c, _h, _w] = (
133 _get_pixel(_b, _c, y0, x0) * (1.0 - (y - y0)) * (1.0 - (x - x0))
134 + _get_pixel(_b, _c, y0, x1) * (1.0 - (y - y0)) * (x - x0)
135 + _get_pixel(_b, _c, y1, x0) * (y - y0) * (1.0 - (x - x0))
136 + _get_pixel(_b, _c, y1, x1) * (y - y0) * (x - x0)
137 )
138
139 def _bicubic_sample():
140 A = -0.75

Callers 1

grid_sample_2dFunction · 0.70

Calls 2

_compute_source_indexFunction · 0.70
_get_pixelFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…