()
| 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 |
no test coverage detected
searching dependent graphs…