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

Function cubic_interp_1d

python/tvm/topi/testing/grid_sample_python.py:148–160  ·  view source on GitHub ↗
(pixel_0, pixel_1, pixel_2, pixel_3, x_fraction)

Source from the content-addressed store, hash-verified

146 return ((A * x_fraction - 5 * A) * x_fraction + 8 * A) * x_fraction - 4 * A
147
148 def cubic_interp_1d(pixel_0, pixel_1, pixel_2, pixel_3, x_fraction):
149 weights = [0] * 4
150 weights[0] = cubic_weight_2(x_fraction + 1)
151 weights[1] = cubic_weight_1(x_fraction)
152 weights[2] = cubic_weight_1(1 - x_fraction)
153 weights[3] = cubic_weight_2(2 - x_fraction)
154
155 return (
156 pixel_0 * weights[0]
157 + pixel_1 * weights[1]
158 + pixel_2 * weights[2]
159 + pixel_3 * weights[3]
160 )
161
162 def coefficients_along_x(x_floor, y_floor, x_fraction):
163 coefficients = [0] * 4

Callers 2

coefficients_along_xFunction · 0.70
_bicubic_sampleFunction · 0.70

Calls 2

cubic_weight_2Function · 0.70
cubic_weight_1Function · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…