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

Function _unnormalize

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

Source from the content-addressed store, hash-verified

58 return 0
59
60 def _unnormalize(h, w):
61 if align_corners:
62 new_h = (h + 1) * (in_height - 1) / 2
63 new_w = (w + 1) * (in_width - 1) / 2
64 else:
65 new_h = -0.5 + (h + 1) * in_height / 2
66 new_w = -0.5 + (w + 1) * in_width / 2
67 return (new_h, new_w)
68
69 def _clip_coordinates(x, size):
70 return min(max(x, 0), size - 1)

Callers 2

_compute_source_indexFunction · 0.70
_bicubic_sampleFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…